Presentation on theme: "Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes."— Presentation transcript:
Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes Review of binary bipolar (signed) codes EE314 Microprocessor Systems
A1.1 Review of number systems Each digit in a decimal number caries two meanings: The value The weight given by the 10 i, where i represent the position of the digit relative to the (decimal) point. The 10 radix (base) For any radix r, the value of a number with n-digit integer part and m-digit fraction part, can be expressed: The digit valueThe weight given by the r i, where i represent the position of the digit relative to the (decimal) point. The used radix (base) The position relative to the radix point. (A1.1) In electronic circuits, the 2 radix is used, associating the two possible digit values to the presence (1) or absence (0) of an electrical signal (voltage) on a transmission line. (A1.2) Binary digiT=bit r-radix numbers
A1.1 Review of number systems Large radix 2 numbers are difficult to analyze by a human observer. Octal numbers (Radix 8) or hexadecimal numbers (radix 16) are used instead. Radix 8 representation uses 8 different digits (0…7). Radix 16 uses 16 different digits (0…9, A, B, C, D, E, F). Every octal digit can be expressed using 3 bits, every hexadecimal digit, using 4 bits. The conversion from radix r=2 k to radix 2 is direct. Every 2 k -digit is replaced by the k-bit binary number having the same value. The reverse conversion groups the bits in packets of k, beginning from the radix point, and end replacing each group with its corresponding 2 k -digit. BCH = Binary-Coded Hexadecimal BCO = Binary-Coded Octal Zeros to complete the group of k bits Separators: “,” or” “ Radix point Binary-Coded Hexadecimal and Binary-Coded Octal numbers
A1.1 Review of number systems Octal numbers or hexadecimal numbers are unusual to a human observer. A way to electrical representation of decimal numbers is the BCD code = Binary-Coded Decimal. Each decimal digit is replaced by the corresponding binary 4 bit number. Bit combinations 1010…1111 are forbidden. The conversions BCD Decimal are direct and similar to BCH Hexadecimal conversions. The conversions BCD Binary are NOT direct (in contrast with BCH Binary and BCO Binary who are direct) Zeros to complete the group of k bits Separators: “,” or” “ Decimal point Binary-Coded Decimal numbers
A1.1 Review of number systems Conversion between decimal and r-radix numbers Performed in decimal arithmetic. (A1.1) r-radix ->decimal Examples decimal -> r-radix Integer part Fraction part
A1.1 Review of number systems Integer decimal to r-radix conversion Examples: Dec.->Bin.Dec.->Hex.
A1.1 Review of number systems Fraction decimal to r-radix conversion Ex: Dec.->Bin. Dec.->Hex.
A1.1 Review of number systems Signed (Bipolar) integer binary numbers Sign bitMagnitude Sign bit To change the sign: Complement the sign bit. Complement all bits. Complement all bits and add 1 LSB. Examples: Signed magnitude: ’ complement: Excess: ’ complement: