Lab Assignment 4
- Read the ``Array'' section of the notes in the
Course Home Page under the heading
``Some Exhaustive Online Notes Fortran 90 : HTML Notes''
- Write Fortran programs for the following.
- Read in 8 bits (0 or 1, one at a time) and print the decimal value
of the corresponding number. Do 2 versions, one in which the
MSB is typed first and one in which the LSB is typed first.
EXAMPLES :
-
MSB is input first
if you read
1 <-- MSB (first bit entered from the standard input)
0
0
0
0
0
1
0 <-- LSB (last bit entered from the standard input)
then the number in binary will be 10000010 and its decimal equivalent
being 130, so print 130.
-
LSB is input first
if you read
1 <-- LSB (first bit entered from the standard input)
0
0
0
0
0
1
0 <-- MSB (last bit entered from the standard input)
then the number in binary will be 01000001 and its decimal equivalent
being 65, so print 65.
- Repeat above problem for 4 character Hexadecimal numbers.
(e.g. 1 A 0 3 = 1*16^3 + 10*16^2 + 0 + 3), ^ implies raised
to.