Chapter 1. Digital Systems and Binary Numbers Tong In Oh 1
1.1 Digital Systems Digital age Characteristic of digital system Generality and flexibility Represent and manipulate discrete elements of information Binary (bit) 0 and 1 Binary codes General purpose digital computer Memory / central processing / input-output HDL Digital system = manipulate discrete quantities of information that are represented in binary form 2
1.2 Binary Numbers 3
1.3 Number-Base Conversions 4
5
1.4 Octal and Hexadecimal Numbers 6
1.5 Complements of Numbers 7
Subtraction with Complements 8
9
1.6 Signed Binary Numbers Plus / minus sign A bit at leftmost position (0 for positive, 1 for negative) Ex. 01001 9 (unsigned binary) +9 (signed binary) Ex. 11001 25 (unsigned binary) -9 (signed binary) Type of representation Signed-magnitude system 10001001 Signed-complement system 1 s complement: 11110110 2 s complement: 11110111 10
Arithmetic Addition Addition of two signed binary numbers with negative numbers represented in signed 2 s complement form Addition of the two numbers, including their sign bits Discard a carry out of the sign bit position Overflow is a problem in computers Number of bits that hold a number is finite A result that exceeds the finite value by 1 cannot be accommodated 11
Arithmetic Subtraction Take the 2 s complement of the subtrahend (including the sign bit) Add it to the minuend (including the sign bit) Discard a carry out of the sign bit position (-6)-(-13)=+7 1111 1010 1111 0011 = 1111 1010 + 0000 1101 = 1 0000 0111 12
1.7 Binary Codes Digital system Signal of two distinct values Circuit elements for two stable states Binary digits Any discrete element of information Represent with a binary code Patterns of 0 s and 1 s N bit binary code: a group of n bits that assumes up to 2 n distinct combinations of 1 s and 0 s Each combination representing one element of the set being coded Ex. (185) 10 = (0001 1000 0101) BCD = (1011 1001) 2 13
BCD Addition Maximum 9+9+1 = 19 (0001 1001)BCD 14
Decimal Arithmetic Represent sign of a decimal number with four bits to conform to the four bit code of the decimal digits To designate a plus with four 0 s and a minus with the BCD equivalent of 9, which is 1001 9 s or 10 s complement Addition by summing all digits, including the sign digit Discarding the end carry Assume that all negative numbers are in 10 s complement form 15
Other Decimal Codes BCD and 2421 code: weighted code Assign each bit position to a weighting factor Each digit can be evaluated by adding the weights of all the 1 s in the coded combination 2421 and excess 3 code: self complementing codes Obtain 9 s complement of a decimal number Directly changing 1 s to 0 s and 0 s to 1 s Excess 3: unweighted code Corresponding binary value plus 3 16
Gray Code Physical quantities are continuous Only one bit in the code group changes in going from one number to the next Normal sequence of binary numbers generated by the hardware may produce an error or ambiguity during the transition from one number to the next 0111 1000 Angular position of a shaft 17
ASCII Character Code 18
Control characters Format effectors / information separators / communication-control 19
Error-Detecting Code To detect errors in data communication and processing Add an eighth bit to the ASCII character to indicate its parity A parity bit is an extra bit included with a message to make the total number of 1 s either even or odd Leftmost position of the code to produce an even number of 1 s in the character for even parity or an odd number of 1 s in the character for odd parity Detects one, three, or any odd combination of errors in each character 20
1.8 Binary Storage and Registers Binary cell: a device that possesses two stable states and is capable of storing one bit (0 or 1) of information Register: a group of binary cells N-tuple of 1 s and 0 s Store discrete elements of information and that the same bit configuration may be interpreted differently for different types of data depending on the application Digital logic circuits Process the binary information stored in the registers 21
Register Transfer The basic elements for storing and holding the binary information 22
1.9 Binary logic 23
24
Logic Gates Electronic circuits that operate on one or more input signals to produce an output signal In a digital system, interpret voltages as two recognizable values (0 or 1) Voltage operated logic circuits: two separate voltage levels Logic 0 = 0V Logic 1 = 3V Acceptable range 25
Logic Gate Circuit Gate: block of hardware that produces the equivalent of logic 1 or logic 0 output signals if input logic requirements are satisfied Transition between logic values occur quickly, but not instantaneously 26