Unit 1-DE
Unit 1-DE
AND
COMPUTER ORGANIZATION
SYLLABUS
MODULE – I
Number systems & Conversions –Arithmetic of number systems –binary codes –BCD –The excess
–3code –Gray code –ASCII –EBCDIC - Introduction to Logic Circuits –logic functions & gates –
Inversion –truth tables –logic gates –truth table of basics gates –timing diagrams of NOT, AND & OR
gates –Boolean algebra –NAND& NOR logic gates - truth table of a logic circuit –de-morgan’s
theorem.
MODULE – II
Logic families –factors affecting performance of a logic family –register transistor logic –diode
transistor logic –DCTL –ECL –TTL logic family –Karnaugh maps –two, three & four-variables
K-map –loops in K-map –mapping of K-maps –don’t care condition
MODULE – III
Combinatorial logic circuits –designing procedure–code converters –multiplexers –multiplexer tree
–demultiplexers /decoders –half & full adder –half & full subtractor –encoders –BCD adder
MODULE – IV
Sequential logic circuits –sequential circuits –SR flip flop –D flip flop –JK flip flop –T flip flop –
flip flop triggering – Shift registers – Design of shift registers design of ripple counters with
examples Design of synchronous counter with examples timing sequences.
MODULE – V
Register transfer logic Inter register transfer Arithmetic, Logic and shift micro operations
Conditional control statements fixed point binary data overflow Arithmetic shifts Instruction codes
Design of simple computer.
Text Books:
1. Morris Mano M, “Digital Logic and Computer Design”, Pearson Education, 4th edition,
2014.
2. S.S. Bhatti & Ragul Malhotra, ”A Textbook of Digital Electronics”, I.K. International
publishing, New Delhi, 2013.
3. Carl Hamacher, Zvonko Vranesic, Safwat Zaky, “Computer Organization”, 5th edition,
McGraw Hill, 2002.
UNIT – 1
NUMBER SYSTEM:
The number system is a way to represent or express numbers. You have heard of various types of
number systems such as the whole numbers and the real numbers. But in the context of
computers, we define other types of number systems. They are:
Example :(123)10
= 1 x 100 + 2 X 10 + 3 X 1
• A computer can understand only the “on” and “off” state of a switch. These two states are
represented by 1 and 0.
• The combination of 1 and 0 form binary numbers. It is called a binary or base 2 number
system.
• Each binary digit is also called a bit.
• Binary number system is also positional value system, where each digit has a value
expressed in powers of 2
• The weightage of each position can be represented as follows
2-4
23 22 21 20 . 2-1 2-2 2-3
MSB LSB
In any binary number, the rightmost digit is called least significant bit (LSB) and leftmost
digit is called most significant bit (MSB).
Example: (11010)2
= 16 + 8 + 0 + 2 + 0
= (26)10
Computer memory is measured in terms of how many bits it can store. Here is a chart for memory
capacity conversion.
= 448 + 16 + 6
= (470)10
4. Hexadecimal numbers:
= 5 x 256 + 1 x 16 + 2 x 1
= 1280 + 16 + 2
= (1298)10
➢ Repeatedly divide the decimal number by 2 and accumulate the remainders unil the
divided is less then 2.
Ex: Convert (17)10 to binary
Ex: Convert (21)10 to Binary
2 21
2 10 - 1
2 5 - 0 (21)10 = (10101)2
2 2 - 1
1 -0
➢ Multiply the fractional part number continuously by 2 and take integer part only in
the reault until the desired accuracy is obtained.
0.735 x 2 = 1.47 -1
0.47 x 2 = 0.94 -0
0.94 x 2 = 1.88 -1
0.88 x 2 = 1.76 -1
0.76 x 2 = 1.52 -1
0.52 x 2 = 1.04 -1
0.04 x 2 = 0.08 -0
(0.735)10 = (1011110)2
➢ Repatedly divide the decimal number by 8 and accumulate the remainder until the
dividend is less the 8
Ex : Convert (100)10 to Octal
8 100
8 12 -4
8 1 - 4 (100)10 = (144)8
➢ Repatedly divide the decimal number by 16 and accumulate the remainder until the
dividend is less the 16
16 437
16 27 -5
Octal Binary
0 000
1 001
2 010
3 011
4 100
5 101
6 110
7 111
Ex: Convert binary number (10011)2 to octal number
010 011
2 3
(10011)2 = (23)8
(10110001101011)2 = (26153)8
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Example: Convert the binary number (101100011011110011)2 to Hexadecimal number
2 C 6 F 3
(101100011011110011)2 = (2C6F3)16
• Converting binary to decimal multiply each binary digit with 2p ( p is the positional
value) and sum all the products.
Ex: (101)2 = 1x22 + 0x21 + 1x20
= 4+0+1
= (5)10
• Converting Octal to decimal multiply each ocatl digit with 8p ( p is the positional value)
and sum all the products.
Ex: (726)8 = 7×82 + 2×81 + 6×80
= 448 + 16 + 6
= (470)10
• Converting hexadecimal to decimal multiply each hexadecimal digit with 16p ( p is the
positional value) and sum all the products.
= 5 x 256 + 1 x 16 + 2 x 1
= 1280 + 16 + 2
= (1298)10
• When converting an octal number to binary, substitute the binary value for each octal
digit(3 bits).
Ex: Convert the octal number (735)8 into binary
7 3 5
111 011 101
(735)8 =(111011101)2
• When converting a hexadecimal number to binary, substitute the binary value for each
hexadecimal digit(4 bits)
Ex: Convert the hexadecimal number (5FA)16 into binary
5 F A
0101 1111 1010
(5FA)16 =(010111111010)2
• When converting an octal number to hexadecimal, first convert the octal to binary
equivalent and then arrange the binary numbers in group of three digits and substitute the
hexadicimal value.
Ex: Convert (245)8 to hexadecimal number
2 4 5
010 100 101
• When converting an hexadecimal number to octal, first convert the hexadecimal to binary
equivalent and then arrange the binary numbers in group of four digits and substitute the
hexadicimal value.
A 1 3
5 0 2 3 (A13)16 = (5023)8
Binary Codes:
• Computers are designed to recognize and process only two values 0 and 1.
• Digital systems represent and manipulate not only binary number, but also many other
discrete elements of information.
• The Binary code can be classified into the following classes
23 22 21 20
8 4 2 1
3 4 5
0011 0100 0101
(345)10 = (001101000101)BCD
Excess-3 code is a modify form of a BCD number. The excess-3 code can be derived from the
natural BCD by adding 3 to each coded number.
Decimal Excess-3
Digit Code
0 0011
1 0100
2 0101
3 0100
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100
• Other non-weighted codes are ASCCI code, EBCDIC code. Gray code .
654
(+) 333
987
Substitute the BCD code for each of the code
9 8 7
1001 1000 0111
0 0000
1 0001
2 0011
3 0010
4 0110
5 0111
6 0101
7 0100
8 1100
9 1101
10 1111
11 1110
12 1010
13 1011
14 1001
15 1000
1 1 0 1
1 0 0
1 0 0 1
Converting Gray Code to Binary:
1 0 1 1
1 0 1
1 1 10
Error detection is the detection of errors caused by noise or other impairments during
transmission from the transmitter to the receiver.
Error correction is thedetection of errors and reconstruction of the original, error-free data.
Parity Checking:
• Parity bit means an additional bit added to the data at the transmitter before transmitting
the data.
• Before adding the parity bit, number of 1’s or zeros is calculated in the data. Based on
this calculation of data an extra bit is added to the actual information / data.
• The addition of parity bit to the data will result in the change of data string size.
• This means if we have an 8 bit data, then after adding a parity bit to the data binary string
it will become a 9 bit binary data string.
There is two types of parity bits in error detection, they are
• Even parity
• Odd parity
The value of even parity bit should be zero, if even number of ones present in the binary code.
Otherwise, it should be one.
The following table shows the even parity codes corresponding to each 3-bit binary code.
Even parity
Binary Code Even Parity bit
code
000 0 0000
001 1 0011
010 1 0101
011 0 0110
100 1 1001
101 0 1010
110 0 1100
111 1 1111
The value of odd parity bit should be zero, if odd number of ones present in the binary code.
Otherwise, it should be one.
The following table shows the odd parity codes corresponding to each 3-bit binary code.
Binary Code Odd Parity bit Odd parity code
000 1 0001
001 0 0010
010 0 0100
011 1 0111
100 0 1000
101 1 1011
110 1 1101
111 0 1110
Hamming Code:
Hamming code is useful for both detection and correction of error present in the received data.
This code uses multiple parity bits and we have to place these parity bits in the positions of
powers of 2.
6. Alphanumeric codes:
• All digital computers should possess the capability of manipulating alphabets and special
characters along with the digital data.
• A complete alphanumeric code would include the 26 lowercase characters, 26 uppercase
characters, 10 numeric digits, etc.
• There are many choices of codes sets to represent alphanumeric characters and several control characters.
Two well accepted code sets are used for information coding
• ASCII Code
• EBCDIC code.
ASCII code:
1. American Standard Code For Information Interchange.
2. It was invented over 50 years ago for displaying text on computer screen.
3. This was accomplished by assigning a number to each letter.
4. These coding schemes generally use 7 or 8 bits to code a character.
5. ASCIIcod was a very compact convention and was available on every computer platform.
6. The standard ASCII code defines 128 character codes (from 0 to 127).
7. The first 32 are control codes that means non printable- codes.
8. Other 96 are representable characters.
9. In addition to the 128 standard ASCII codes there are other 128 that are known as extended ASCII
codes.
10. Some of the ASCII codes are
6 Space bar 32
EBCDIC code
• Extended Binary Coded Decimal Interchange Code.
• It is a character encoding set developed by IBM.
• EBCDI uses the full 8 bits available to it.
• Parity checking cannot be used on 8-bits system
• It has a wider range of control characters than ASCII.
• The character encoding is based on BCD.
Binary Arithmetic:
We can perform four types of operations in binary arithmetic.
1. Addition
2. Subtraction
3. Multiplication
4. Division
1.Binary Addition:
A binary addition operation requires two operands (Addend andAugend) and the binary
addition operator(+). The rules for binary addition are
Carry 11 111
Addend 1 10111
Augend 1 10011
Result 1101010
Carry 1 1111
Addend 1 1 0 1 .1 1 1
Augend 0 1 0 1 .1 0 1
Result 1 0 0 1 1 .1 0 0
2. Binary Subtraction :
A binary subtraction operation requires two operands (minuend and subtrahend) and the
binary subtraction operator (-). The rules for subtraction are
Barrow 1
10 10
Minuend 1 0 0 1
Subtrahend 0 1 1 1
Result 0 0 1 0
Barrow 10 10
Minuend 1 10 1 . 1 1
Subtrahend 0 1 1 1 . 0 1
Result 110.10
3. Multiplication :
A Binary multiplication operation requires a binary multiplication operator (*) and two
operands (multiplicand and multiplier). The rules for the binary multiplication are
AxB Multiplication
0x0 0
0x1 0
1x0 0
1x1 1
Multiplicand 1101
Multiplier 101
1101
0000
1101
1000001
4. Binary Division:
A binary division operation requires a binary dividion operator(/) and two operands
(dividend and divisor). The rules for the binary division are
A/ B Result
1/1 1
0/1 0
101
101 11001
101
101
101
0
Negative number:
In this method the magnitude of the postive number is stored in a normal form, whareas the
magnitude of the negative number is stored by introducing a 1 in the MSB called signed bit
postion.
10 = 00001010
-10 = 10001010
** Sign bit representation has a lot of disadvantages instead of we can use complements to
represent negative numbers
COMPLEMENT
S
1. r’s compliment
2. (r-1)’s compliment
• r’s compliment support
1. 10’s compliment
2. 2’s compliment
• (r-1)’s compliments
1.9’s complement
2. 1’s complement
r’s complements
• The r’s complement of a positive value P in radix r is obtained by using the formula
rn – P, where n is the total number of digits in P.
n = 5 (no.of digits)
= 100000 – 31593
= 68407
= 10 – 1.52
= 8.48
2’s
complements
base r=2
=1000000-101100
= 01010
II method:
• Retaining all the 0’s from the right hand side (LSB), till a 1 is encountered.
• Retain the first 1 too, and change all the 0’s to 1’s and 1’s to 0’s.
0011100
III method:
(r-1)’s Complement
• (r-1)’s complement can be represented by the formula (rn -1) – P, where n is the total number
of digits in positive value P.
9’s Complenet
Find the 9’s complement of (4752)10
1’s Complement
The (r-1) complement of binary number can be obtained by changing the 0’1 to 1’s and 1’s to 0’s.
Ex: Find the 1’s complent of 1100100
1’s complement of 1100100 = 0011011
Introduction to logic Circuits:
● Digital electronic circuits operate with voltages of two logic levels namely Logic Low
and Logic High.
● The value for Logic Low is represented with ‘0’ or ‘false’.
● The value for Logic High is represented with ‘1’ or ‘true’/
● A Digital Logic Gate is an electronic circuit which makes logical decisions based on the
combination of digital signals present on its inputs.
● Digital logic gates can have more than one input but generally only have
onedigital output.
OR gate:
● OR gate performs Logical addition operation.
● This operation is represented by plus(+) operator
● The expression for OR operation is
Y=A+B
● OR operation produces result 1 when any one of the input is 1,otherwise it is 0.
Truth Table
Inputs Output
A B Y=A+B
0 0 0
0 1 1
1 0 1
1 1 1
AND gate:
● AND gate performs Logical Multiplication operation.
● This operation is represented by dot(.) operator
● The expression for OR operation is
Y=A.B
● AND operation produces result 1 when all the inputs are 1,otherwise it is 0.
Logic Circuit forAND gate:
Truth Table
Inputs Output
A B Y=A.B
0 0 0
0 1 0
1 0 0
1 1 1
NOT gate:
● NOT gate performs Logical Inverse or Complementation.
● This operation uses only one input.
● The expression for NOT operation is
●
Y = A’ or A
● NOT operation produces reverse value for the input.
● If input is 1, the result is complemented to 0 and if the input is 0, the result is
complemented to 1.
Logic Circuit forAND gate:
Truth Table
Input Output
A Y=A
0 1
1 0
Buffer:
● A buffer is a temporary storage area.
● The output of the buffer is the same as its input.
● The main operation is to store the data that is placed on it for a certain amount of time.
Logic Circuit forBuffer is:
A Y= A
Truth Table:
Input Output
A Y= A
0 0
1 1
Derived Gates: The gates which can be derived from the basic gates are called derived gates.
NOR,NAND,XOR,XNOR are the derived gates.
NOR gate:
● The NOR gate is the complement of the OR operation and it is also called Not-OR
● The expression for OR operation is
Y=A+B
● NOT operation if all inputs are 0 then the result is 1, otherwise it is 0.
● NOT operation produces result 0 when any of the input is 1.
(OR)
Truth Table
Input Output
Y=A+
A B
B
0 0 1
0 1 0
1 0 0
1 1 0
NAND gate:
● The NAND gate is the complement of the AND operation and it is also called Not-AND
● The expression for NAND operation is
Y=A.B
● NAND operation if all the inputs are 1 then the result is 0,otherwise it is 1.
(OR)
Truth Table
Input Output
A B Z=A.B
0 0 1
0 1 1
1 0 1
1 1 0
Input Output
A B Y=A ⊕ B
0 0 0
0 1 1
1 0 1
1 1 0
Truth Table
Input Output
A B Y=A ⊙ B
0 0 1
0 1 0
1 0 0
1 1 1
Hierarchy of logic circuits:
1. Parantheses have the highest priority
2. Inversion have next highest priority
3. AND operation
4. OR operation
5. If an expression has a bar over it, the operation should be performed first and the result
should be inverted next.
Boolean Algebra:
A brief description of the various Laws of Boolean are given below with Arepresenting a
variable input.
BOOLEAN FUNCTIONS:
MAX TERM:
● Four possible combination of OR binary values x’+y’, x’+y, x+y’, x+y.
● These four term of distinct area is called maximum term.
● The procedures for obtaining product of max term directly form the truth table.
● From a max term for each combination of the variable which produces a 0 in the function
AND of all those max term.
● Boolean function expressed as a some of min term of product max term as set to be a
canonical form.
0 0 m0=x’y’ M0=x + y
0 1 m1=x’y M1=x + y’
1 0 m2=xy’ M2=x’ + y
1 1 m3=xy M3=x’ + y’
Sum of Minterms
i) Express the Boolean function F=A+B’C in a sum of minterms.
Sol:
● This function has three variables: x, y, and z.
● All terms must have these three variables.
1st term
A=A(B+B’)
=AB+AB’
=AB(C+C’)=AB’(C+C’)
=ABC+ABC’+AB’C+AB’C’
2 term
nd
B’C= B’C(A+A’)
=AB’C+A’B’C
A+B’C = ABC+ABC’+AB’C+AB’C’+AB’C+A’B’C
=m1+M4+m5+m6+m7
F(A,B,C)=£(1,4,5,6,7)
2. Express the Boolean function F = x + y z as a sum of minterms
Sol:
● This function has three variables: x, y, and z.
● All terms must have these three variables.
● Thus, we need to expand the first term by ANDing it with (y + y')(z + z'), and we expand
the second term with (x + x') to get
F=x+yz
= x (y + y') (z + z') + (x + x') y z
= x y z + x y z' + x y' z + x y' z' + x y z + x' y z
= x' y z + x y' z' + x y' z + x y z' + x y z
= m3 + m4 + m5 + m6 + m7
= Σ(3, 4, 5, 6, 7)
Solve the following boolean function to sum of min terms
i) F(x,y,z)= (xy+z)
ii) F(x,y,z)=x(y’+z)+yz
SOP uses minterms. Minterm is product POS uses maxterms. Maxterm is sum
of boolean variables either in normal of boolean variables either in normal
2. form or complemented form. form or complemented form.
SOP is formed by considering all the POS is formed by considering all the
4. minterms, whose output is HIGH(1) maxterms, whose output is LOW(0)
While writing minterms for SOP, input While writing maxterms for POS, input
with value 1 is considered as the with value 1 is considered as the
variable itself and input with value 0 is complement and input with value 0 is
5. considered as complement of the input. considered as the variable itself.