CS220 Lecture 05 and 06
CS220 Lecture 05 and 06
Revision Exercises
Be familiar with Boolean algebra theorems for manipulating expressions
into desired forms
Understand how to draw and plot K-Maps for functions with different
numbers of input variables, how to label the axes using Gray code
In Today’s Class
Converting sum of products to NAND only form
Binary System
Computer Circuits are composed of transistor devices and to
allow them to deal efficiently with numbers and other data, the
binary system is used to represent data values.
Binary System
Binary System
Addition Definition
0 + 0 = 0 sum
0 + 1 = 1 sum
1 + 0 = 1 sum
1 + 1 = 0 sum with a carry over of 1, i.e. 10
CS220 Computer Architecture
Digital Logic Design
Addition Examples
Note that the sum can be one digit longer than either operand.
CS220 Computer Architecture
Digital Logic Design
Subtraction Definition
0 - 0 = 0 Difference
1 - 0 = 1 Difference
1 - 1 = 0 Difference
0 - 1 = 1 Difference with a Borrow of 1
CS220 Computer Architecture
Digital Logic Design
Subtraction Examples
CS220 Computer Architecture
Digital Logic Design
Multiplication Definition
0 x 0 = 0 Product
0 x 1 = 0 Product
1 x 0 = 0 Product
1 x 1 = 1 Product
CS220 Computer Architecture
Digital Logic Design
Division Definition
0 0 is not a number
0 1 is 0 Quotient
1 0 is not a number
1 1 is 1 Quotient
CS220 Computer Architecture
Digital Logic Design
148 -128 = 20
20 - 16 = 4
4-4=0
148 = 128 + 16 + 4
= 27 + 24 + 22
= 100101002
CS220 Computer Architecture
Digital Logic Design
A signed integer encodes the sign of a number along with its magnitude
giving a range of negative and positive numbers which can be encoded
-2n-1 .. +2n-1 -1.
For example, using an 8-bit binary representation we would be able to
express a range from -128 .. +127, so for the same number of bits, the
maximum magnitude is halved.
CS220 Computer Architecture
Digital Logic Design
One way of encoding the sign and magnitude is to use one bit
position (say the highest bit) to represent the sign of a number
and the rest of the bits to represent the magnitude.
The sign bit is treated separately from the magnitude bits by the
arithmetic hardware.
CS220 Computer Architecture
Digital Logic Design
0 0 0 1 0 1 1 02 = +2210
CS220 Computer Architecture
Digital Logic Design
0 0 0 1 0 1 1 02 = +2210
Hexadecimal Notation
Sometimes hexadecimal notation provides a convenient way of
representing large data values as it is easy to translate values to
binary and is less unwieldy.
Hexadecimal Notation
The following table gives the binary, decimal and hexadecimal
representation for different numbers.
CS220 Computer Architecture
Digital Logic Design
Note that if there are several digits in the operands, the half
adder cannot account for carry-ins from lower bit positions.
Exercise: Design a 1-bit full adder circuit using only five 2-input
gates. The gates used may be of any type including XOR, AND,
OR, NOT.
Adder/Subtractor Circuit
While the sum value for each bit position can be calculated in
parallel, we need an accelerated way of generating the carry to
overcome the serial performance limitations of the ripple carry
design.