Chapter 2 Micro Processor and Computer in Measurement
Chapter 2 Micro Processor and Computer in Measurement
• Changing the first (sign) bit to a 1 would change the number stored
to - 119 x 2-2.
• enter numbers in these binary forms, the procedure would be both
highly tedious and also very prone to error. Simpler ways of entering
binary numbers are octal and hexadecimal numbers.
• Octal numbers is a base of 8 and consist of decimal digits in the
range 0–7 that each represent 3 binary digits. Thus 8 octal digits
represent a 24-bit binary number.
• Hexadecimal numbers have a base of 16. Decimal digits in the
range 0–9 and letters in the range A–F that each represent 4 binary
digits. Decimal digits 0–9 translate directly to the decimal values 0–9
and the letters A–F translate respectively to the decimal values 10–
15.
• Eg: 1 Convert the octal number 7654 to binary.
Solution: Using the table above, write down the binary equivalent of
each octal digit:
!7 ! 6 ! 5 ! 4 ! = j 111 j 110 j 101 j 100 j. Thus, the binary code is
111110101100.
Eg: 2. Convert the hexadecimal number ABCD to binary
Solution: Using the table above, write down the binary equivalent of
each hexadecimal digit:
j A j B j C j D j = j 1010 j 1011 j 1100 j 1101 j. Thus, the binary code is
1010101111001101.
Eg: 3. Convert the binary number 010111011001 into octal and
hexadecimal
• Eg.4 The 24-bit binary number 011111001001001101011010 is to be
entered into a computer. How would it be entered using (a) octal code
and (b) hexadecimal code?
• In carrying out such conversions, it is essential that the groupings of
binary digits start from the right-hand side.
• Groupings starting at the left-hand side give completely wrong
values unless the number of binary digits happens to be an integer
multiple of the grouping size.
• Consider a 10-digit binary number: 1011100011. Grouping digits
starting at the right-hand side gives the values 1343 octal and 2E3
hexadecimal.
• Grouping digits starting at the left gives the (incorrect) values of
5611 octal and B83 hexadecimal.
• When converting a binary number to octal or hexadecimal
representation, a check must also be made that all of the binary
digits represent data. In some systems, the first (left-hand) digit is
used as a sign bit and the last (right-hand) digit is used as a parity
bit.
Analogue-to-digital converters
• Important factors in the design of an analogue-to-digital converter are the
speed of conversion and the number of digital bits used to represent the
analogue signal level.
• The minimum number of bits used in analogue-to-digital converters is 8.