DLD Lacture 2 Chapter 1 Digital Systems and Binary Numbers
DLD Lacture 2 Chapter 1 Digital Systems and Binary Numbers
Chapter 1
Digital Systems and Binary Numbers
Below table lists all possible four-bit signed binary numbers in the
three representations for “ -9 ”.
If the signs are the same, we add the two magnitudes and give the sum the
common sign. If the signs are different, we subtract the smaller magnitude
from the larger and give the difference the sign if the larger magnitude.
This process requires the comparison of the signs and magnitude before
addition and subtraction
( A) ( B) ( A) ( B)
Example:
( A) ( B) ( A) ( B)
( 6) ( 13) (11111010 11110011)
(11111010 + 00001101)
00000111 (+ 7)
Digital Logic Design Ch1-8
Signed Binary Numbers…(contd.)
BCD Code
A number with k decimal digits will
require 4k bits in BCD.
Decimal 396 is represented in BCD
with 12bits as 0011 1001 0110, with
each group of 4 bits representing one
decimal digit.
A decimal number in BCD is the
same as its equivalent binary number
only when the number is between 0
and 9.
The binary combinations 1010
through 1111 are not used and have
no meaning in BCD.
Example:
Consider decimal 185 and its corresponding value in BCD and binary:
BCD addition
If a 4-bit sum is equal to or less than 9, it is a valid BCD number.
If a 4-bit sum > 9, or if a carry out of the 4-bit group is generated
it is an invalid result. Add 6 (0110) to a 4-bit sum in order to skip
the six invalid states and return the code to 8421. If a carry results
when 6 is added, simply add the carry to the next 4-bit group
Example:
Consider the addition of 184 + 576 = 760 in BCD:
Subtract the two BCD numbers, using the rules for basic binary
subtraction.
If there is no borrow from the next higher group, no correction is
required.
If there is borrow from the next group, then (0110) is subtracted
from the difference term of this group.
A register with n cells can store any discrete quantity of information that contains n
bits.
n cells 2n possible states
A binary cell
Two stable state
Store one bit of information
Examples: flip-flop circuits, ferrite cores, capacitor
A register
A group of binary cells
PC in x86 CPU
Register Transfer
A transfer of the information stored in one register to another.
One of the major operations in digital system.
An example in next slides.
Memory
Control
CPU unit Datapath
Figure 1.1 Transfer of information among register Digital Logic Design Ch1-26
Two elements of a computer system
Figure 1.2 Example of binary information processing Digital Logic Design Ch1-28