You are on page 1of 26

1: NUMBER SYSTEMS, BOOLEAN ALGEBRA AND LOGIC GATES

STRUCTURE
1.0 Objectives
1.1 Introduction
1.2 Number Systems
1.2.1 Binary Number System
1.2.2 Octal Number System
1.2.3 Hexadecimal Number System
1.2.4 Binary Arithmetic
1.2.5 BCD Addition
1.2.6 Alphanumeric Codes
Check Your Progress 1
1.3 Boolean Algebra and Logic Gates
1.3.1 AND Gate
1.3.2 OR Gate
1.3.3 NOT Gate
1.3.4 NAND Gate
1.3.5 NOR Gate
1.3.6 XOR Gate
1.3.7 Basic Laws of Boolean Algebra
1.3.8 De-Morgans Theorems
Check Your Progress 2
1.4 Summary
1.5 Glossary
1.6 References
1.7 Answers to Check Your Progress Questions

1.0 OBJECTIVES
After going through this unit, you will be able to
A
u
understand
the decimal, binary, octal and hexadecimal number systems
cconvert from one number system into another
aapply arithmetic operations to binary numbers
uunderstand BCD codes and alpha numeric codes
llearn the operations of logic gates
apply the basic laws of Boolean algebra
apply De Morgans theorems to Boolean expressions .

1.1 INTRODUCTION
The binary number system and digital codes are fundamental to computers. In this chapter, the
binary number system and its relationship to other systems such as decimal, hexadecimal, and
octal are introduced. Arithmetic operations with binary numbers are discussed to provide a
basis for understanding how computers and many other types of digital systems work. Also
binary coded decimal (BCD), and alpha numeric codes are introduced. Binary logic gates are
explained with the help of logic diagram, block diagram and truth table. Basic laws of Boolean
Algebra are given. DeMorgans theorems are also stated and proved.

1.2 NUMBER SYSTEMS


A number system relates quantities and symbols. The base or radix of a number system
represents the number of digits or basic symbols in that particular number system. In decimal
system the base is 10, because of use the numbers 0, 1, 2,3,4,5,6,7,8 and 9.

1.2.1 Binary Number System


A binary number system is a code that uses only two basic symbols. The digits can be any
two distinct characters, but it should be 0 or 1. The binary equivalent for some decimal
numbers are given below
Decimal 0 1 2 3 4 5 6 7 8 9 10 11 Binary 0 1 10 11 100 101 110 111 1000 1001 1010 1011
16 number has a value or weight. The LSB has a value of 1. The
Each digit in a binary
second from the right8has a value of 2, the next 4 , etc.,
4
2
1
24
23
22
21
20

Binary to decimal conversion:


(1001)2 = X10
1001 =1x23 + 0x22 + 0x21 +1x20 =8+0+0+1 (1001)2 = (9)10
Fractions: For fractions the weights of the digit positions are written from right of the binary
point and weights are given as follows.
E.g.:
-

=0x2
ffd8ffe000104a4649460001020100600060000 (0.0110) 2= X10
1
-2
-3
-4
0ffe20c584943435f50524f46494c45000101000 + 1x2 + 1x2 + 0x2
00c484c696e6f021000006d6e747252474220585=0 x0.5 + 1x0.25 + 1x0.125 +
95a2007ce00020009000600310000616373704d 0x0.0625
= (0.375)10
534654000000004945432073524742000000000
0000000000000000000f6d6000100000000d32d
E.g.:
485020200000000000000000000000000000000 (1011.101) 2=X10 =1x23 + 0x22 +
000000000000000000000000000000000000000 1x21 + 1x20 + 1x2-1 + 0x2-2 + 1x2-3
000000000000000000000000116370727400000 =8 + 0 + 2 + 1 + 0.5 + 0 + 0.125
1500000003364657363000001840000006c7774 = (11.625)10
7074000001f000000014626b707400000204000
000147258595a00000218000000146758595a00
00022c000000146258595a00000240000000146
Decimal
46d6e640000025400000070646d6464000002c4
to
00000088767565640000034c000000867669657
binary 7000003d4000000246c756d69000003f8000000
146d6561730000040c000000247465636800000
4300000000c725452430000043c0000080c6754
52430000043c0000080c625452430000043c000
0080c7465787400000000436f70797269676874
202863292031393938204865776c6574742d506
1636b61726420436f6d70616e79000064657363
000000000000001273524742204945433631393
6362d322e310000000000000000000000127352
47422049454336313936362d322e31000000000
000000000000000000000000000000000000000
000000
conversion: (Double Dabble
method)
In this method the decimal number is divided by 2 progressively and the remainder is
written after each division. Then the remainders are taken in the reverse order to form the
binary number.
E.g.:
(12)10 = X2

(12)10 = (1100)2

E.g.:

ffd8ffe000104a46494600010201005f005f0000ffe20c58494
3435f50524f46494c4500010100000c484c696e6f021000006
d6e74725247422058595a2007ce0002000900060031000061
6373704d5346540000000049454320735247420000000000
000000000000000000f6d6000100000000d32d48502020000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000011637
07274000001500000003364657363000001840000006c7774
7074000001f000000014626b7074000002040000001472585
95a00000218000000146758595a0000022c00000014625859
5a0000024000000014646d6e640000025400000070646d646
4000002c400000088767565640000034c0000008676696577
000003d4000000246c756d69000003f8000000146d6561730
000040c0000002474656368000004300000000c7254524300
00043c0000080c675452430000043c0000080c62545243000
0043c0000080c7465787400000000436f7079726967687420
2863292031393938204865776c6574742d5061636b6172642
0436f6d70616e790000646573630000000000000012735247
422049454336313936362d322e31000000000000000000000
012735247422049454336313936362d322e31000000000000
000000000000000000000000000000000000000000

(21)2 = X2
(21)2
Fractions:

ffd8ffe000104a46494600010201005f005f0000ffe20c584
943435f50524f46494c4500010100000c484c696e6f02100
0006d6e74725247422058595a2007ce0002000900060031
0000616373704d534654000000004945432073524742000
0000000000000000000000000f6d6000100000000d32d48
50202000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000
00000011637072740000015000000033646573630000018
40000006c77747074000001f000000014626b7074000002
04000000147258595a00000218000000146758595a00000
22c000000146258595a0000024000000014646d6e640000
025400000070646d6464000002c40000008876756564000
0034c0000008676696577000003d4000000246c756d6900
0003f8000000146d6561730000040c00000024746563680
00004300000000c725452430000043c0000080c67545243
0000043c0000080c625452430000043c0000080c7465787
400000000436f7079726967687420286329203139393820
4865776c6574742d5061636b61726420436f6d70616e790
00064657363000000000000001273524742204945433631
3936362d322e31000000000000000000000012735247422
049454336313936362d322e310000000000000000000000
00000000000000000000000000000000

The fraction
integer
Then they are
corresponding
E.g.:

= (10101)2

is multiplied by 2 and the carry in the


position is written after each multiplication.
written in the forward order to get the
binary equivalent.
(0.4375)10 = X2

2
x
0.4375 = 0.8750 => 0 2 x 0.8750 = 1.750
=> 1 2 x 0. 750 = 1.5 => 1 2 x 0.5 = 1.0 => 1
(0.4375)10 = (0.0111)2

1.2.2 Octal Number System


Octal number system has a base of 8 i.e., it has eight basic symbols. First eight decimal digits
0, 1,2,3,4,5,6,7 are used in this system.
Octal to decimal conversion:
In the octal number system each digit corresponds to the powers of 8. The weight of digital
position in octal number is as follows
To convert from octal to decimal multiply each octal digit by its weight and add the resulting
products.

ffd8ffe000104a46494600010201006000600000ffe20c584
943435f50524f46494c4500010100000c484c696e6f021000 E.g.:
006d6e74725247422058595a2007ce000200090006003100
00616373704d534654000000004945432073524742000000
0000000000000000000000f6d6000100000000d32d485020
200000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
116370727400000150000000336465736300000184000000
6c77747074000001f000000014626b707400000204000000
147258595a00000218000000146758595a0000022c000000
146258595a0000024000000014646d6e6400000254000000
70646d6464000002c400000088767565640000034c000000
8676696577000003d4000000246c756d69000003f8000000
146d6561730000040c000000247465636800000430000000
0c725452430000043c0000080c675452430000043c000008
0c625452430000043c0000080c7465787400000000436f70
797269676874202863292031393938204865776c6574742d
5061636b61726420436f6d70616e79000064657363000000
0000000012735247422049454336313936362d322e310000
00000000000000000012735247422049454336313936362d
322e31000000000000000000000000000000000000000000
000000000000

(48)8 = X10
48 = 4 x 81 + 7 x 80

= 32 + 7

= 39

(48)8 = (39)10
E.g.:
(22.34)8 = X10
22.34 = 2 x 81 + 2 x 80 + 3 x 8-1 + 4 x 8-2
= (18.4375)

=16 + 2 + 3 x 1/8 +4 x 1/64

(22.34)8 = (18.4375)10
Decimal to octal conversion:
Here the number is divided by 8 progressively and each time the remainder is written and
finally the remainders are written in the reverse order to form the octal number. If the number
has a fraction part, that part is multiplied by 8 and carry in the integer part is taken. Finally the
carries are taken in the forward order.
E.g.:
(19.11)10 = X8

Octal
Since
octal
three.
E.g.:

ffd8ffe000104a464946000102010
05f005f0000ffe20c584943435f505
24f46494c4500010100000c484c69
6e6f021000006d6e7472524742205
8595a2007ce000200090006003100
00616373704d5346540000000049
4543207352474200000000000000
00000000000000f6d600010000000
0d32d48502020000000000000000
0000000000000000000000000000
0000000000000000000000000000
0000000000000000000000011637
0727400000150000000336465736
3000001840000006c777470740000
01f000000014626b7074000002040
00000147258595a00000218000000
146758595a0000022c00000014625
8595a0000024000000014646d6e64
0000025400000070646d64640000
02c400000088767565640000034c0
000008676696577000003d400000
0246c756d69000003f8000000146d
6561730000040c000000247465636
8000004300000000c725452430000
043c0000080c675452430000043c0
000080c625452430000043c000008
0c7465787400000000436f7079726
9676874202863292031393938204
865776c6574742d5061636b617264
20436f6d70616e790000646573630
00000000000001273524742204945
4336313936362d322e31000000000
00000000000001273524742204945
4336313936362d322e31000000000
0000000000000000000000000000
00000000000000000

0.11 x 8 = 0.88 => 0


0.88 x 8 = 7.04 => 7
0.04 x 8 = 0.32 => 0
0.32 x 8 = 2.56 => 2
0.56 x 8 = 4.48 => 4
(19.11)10 = (23.07024)8

to binary conversion:
the base of octal number is 8, i.e., the third power of 2, each
number is converted into its equivalent binary digit of length

(57.127)8 = X2
5 7 . 1 2 7 101 111 . 001 010 111
(57.127)8 = (101111001010111)2
Binary to octal:
The given binary number is grouped into a group of 3 bits, starting at the octal point and
each group is converted into its octal equivalent.
E.g.:

Decimal
Hexadecimal
(1101101.11101)2 = X8 001 101 101.111 010
Binary
0
0
1 5 5 . 7 2 (1101101.11101)2 = (155.72) 8
0000
1
1
1.2.3 Hexadecimal
Number System:
0001
2
The hexadecimal
2 number system has a base of 16. It has 16 symbols from 0 through 9 and A
through F. 0010
3
3
0011
4
Binary to hexadecimal:
4
0100
5
5
0101
6
6
0110
7
7
0111
8
8
1000
9
9
1001
10
A
1010
11
B
1011
12
C
1100
13
D
1101
14

1110
15
F
1111

The binary number is grouped into bits of 4 from the binary point then the corresponding
hexadecimal equivalent is written.
E.g.:
(100101110 . 11011) 2 = X16
0001 0010 1110 . 1101 1000
12E.D8
(100101110 . 11011) 2 = (12E . D8)16
Hexadecimal to binary:
Since the base of hexadecimal number is 16, i.e., the fourth power of 2, each hexadecimal
number is converted into its equivalent binary digit of length four.
E.g.:
(5D. 2A)16 = X2 5 D . 2 A 0101 1101 . 0010 1010 (5D. 2A)16 = (01011101.00101010)2
Decimal to hexadecimal:
The decimal number is divided by 16 and carries are taken after each division and then written
in the reverse order. The fractional part is multiplied by 16 and carry is taken in the forward
order.

E.g.:
(2479.859)) 10 = X 16

16 x 0.859 = 13.744 => 13 (D)

ffd8ffe000104a46494600010201005f005f0000ffe20c58494343
5f50524f46494c4500010100000c484c696e6f021000006d6e747
25247422058595a2007ce00020009000600310000616373704d5
3465400000000494543207352474200000000000000000000000
00000f6d6000100000000d32d485020200000000000000000000
0000000000000000000000000000000000000000000000000000
0000000000000000000000011637072740000015000000033646
57363000001840000006c77747074000001f000000014626b707
400000204000000147258595a00000218000000146758595a000
0022c000000146258595a0000024000000014646d6e640000025
400000070646d6464000002c400000088767565640000034c000
0008676696577000003d4000000246c756d69000003f80000001
46d6561730000040c0000002474656368000004300000000c725
452430000043c0000080c675452430000043c0000080c6254524
30000043c0000080c7465787400000000436f707972696768742
02863292031393938204865776c6574742d5061636b617264204
36f6d70616e79000064657363000000000000001273524742204
9454336313936362d322e3100000000000000000000001273524
7422049454336313936362d322e3100000000000000000000000
0000000000000000000000000000000

16 x 0.744 = 11.904 => 11 (B) 16 x 0.904 = 14.464 => 14 (E) 16 x 0.464 = 7.424 => 7 16 x
0.424 = 6.784 => 6
(2479.859)10 = (9AF.DBE76)16
Hexadecimal to decimal:
Each digit of the hexadecimal number is multiplied by its weight and then added.
E.g.:
(81.21) 16 = X10 =8 x 161 + 1 x 160 + 2 x 16-1 + 1 x 16-2 =8 x 16 + 1 x 1 + 2/16 + 1/162 =
(129.1289)10
(81.21) 16 = (129.1289)10

1.2.4 Binary Arithmetic Binary Addition:


To perform the binary addition we have to follow the binary table given below.
0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 => plus a carry-over of 1
Carry-overs are performed in the same manner as in decimal arithmetic. Since 1 is the largest
digit in the binary system, any sum greater than 1 requires that a digit be considered over.

Binary Subtraction:
To perform the binary subtraction the following binary subtraction table should be followed.

0 0 = 0 1 0 = 1 1 1 = 0 E.g.:
0 1 = 1 with a borrow of 1 is equivalent to 10 1 = 1
111
_1101001
1010
_110110111
11.01 101.11 1001.00

E.g.:
111 010 101
E.g.:
110.01
100.10
001.11
1s complement:
To obtain 1s complement of a binary number each bit of the number is subtracted from 1.

Thus 1s complement of a binary number is the number that results when we change each 0 to
a 1 and each 1 to a 0.
1s complement subtraction:
Instead of subtracting the second number from the first, the 1s complement of the second
E.g.:The last carry which is said to be a END AROUND
number is added to the first number.
CARRY, is added to get the final Binary
result. number
1s Complement
E.g.:
0101 1001 1101 0001
7 -111 -----------------> 111 +
1010011000101110
3 011 1s complement 100
4 1011 + 1
100 result If there is no carry in the 1s complement subtraction, it indicates that the result is
a negative and number will be in its 1s complement form. So complement it to get the final
result.

E.g.:
8 -1000 -----------------> 1000 + 10 1010 1s complement 0101 4 1101 1s complement 0010 result

The following points should be noted down when we do 1s complement subtraction.


1Write the first number (minuend) as such.
2Write the 1s complement of second number(subtrahend)
3Add the two numbers.
4The carry that arises from the addition is said to be end around carry.
5End-around carry should be added with the sum to get the result.
6If there is no end around carry find out the 1s complement of the sum and put a negative sign
before the result as the result is negative.
2s Complement:
2s complement results when we add 1 to 1s complement of the given number i.e., 2s
complement =1s complement + 1
Binary Number 1s complement 2s complement
1010 0101 0110 0101 1010 1011 1001 0110 0111 0001 1110 1111
2s Complement Subtraction:
Steps:
1Write the first number as such
2Write down the 2s complement of the second number.
3Add the two numbers.
4If there is a carry, discard it and the remaining part (sum) will be the result (positive).
5If there is no carry, find out the 2s complement of the sum and put negative sign before the
result as the result is negative.

E.g.:
10 ?8 2
1010 -----------------> 1010 + 1000 2s complement 100010010

1)

Binary multiplication:
0010 ? result
The table for binary multiplication is given below

2)

5 ?12 4
0x0=00x1=01x0=01x1=1
0101 -----------------> 0101 + 1100 2s complement 01001001 2s complement 0111? result
E.g.:
1011 x 110
1011 x 110 0000
1011 1011 __ 1000010_
E.g.:
101.01 x 11.01
101.01 x
11.01 101 01 00000 10101
_10101__ 10001.0001

Binary division:
The table for binary division is as follows.
01=01
1=1
As in the decimal system division by zero is meaning less.
E.g.:
1) 1100 11
100_ 111100 11__
0
2) 1001 10
_100.
1 10
1001
10__
0010 10
0
1.2.5 BCD Addition
Binary Coded Decimal(BCD) is a way to express each of the decimal digits with a
binary code. There are only ten code groups in the BCD system. The 8421 code is a
type of BCD code. In BCD each decimal digit , 0 through 9 is represented by a binary
code of four bits. The designation of 8421 indicates the binary weights of the four
bits (23,22,21,20). The largest 4-bit code is 1001. The numbers 1010, 1011, 1100, 1101,
1110, and 1111 are called forbidden numbers. The following table represents the
decimal and 8421 equivalent numbers.
Decimal digit 0 1 2 3 4 5 6 7 8 9 BCD 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001
8421 Addition:
In 8421 addition, if there is a carry or if it results in a forbidden group, then 0110(6) should
be added in order to bring the result to the 8421 mode again.

E.g.:
8 + 1000 + 7 0111 15 1111
+ 0110 0001 0101
E.g.:
18 + 0001 1000 + 2 0000 0010 20
0001 1010
+ 0000 0110 0010 0000

1.2.6 Alphanumeric code


Computers, printers and the other devices must process both alphabetic and numeric
information. Serial coding systems have been developed to represent alphanumeric information
as a series of 1s and 0s. The characters to be coded are alphabets(26), numerals (10) and
special characters such as +,-, /,*, $ etc,
In order to code a character, string of binary digits is used. In order to ensure uniformity in
coding, two standard codes have been used.
1ASCII: American Standard Code for Information Interchange.
2EBCDIC: Extended Binary Coded Decimal Interchange Code. It is an 8 bit code.
ASCII is 7-bit code of the form X6, X5, X4, X3, X2, X1, X0 and is used to code two types of
information. One type is the printable character such as alphabets, digits and special characters.
The other type is known as control characters which represent the coded information to control
the operation of the digital computer and are not printed.

CHECK YOUR PROGRESS 1


1. 2 x 101 + 8 x 100 is equal to
(a) 10 (b) 280 (c) 2.8 (d) 28
2. The binary number 1101 is equal to the decimal number
(a) 13 (b) 49 (c) 11 (d) 3
3. The decimal 17 is equal to the binary number
(a) 10010 (b) 11000 (c) 10001 (d) 01001
4. The sum of 11010 + 01111 equals
(a) 101001 (b) 101010 (c) 110101 (d) 101000

5. The difference of 110 010 equals


(a) 001 (b) 010 (c) 101 (d) 100
6. The 1s complement of 10111001 is
(a) 01000111 (b) 01000110 (c) 11000110 (d) 10101010
7. The 2s complement of 11001000 is
(a) 00110111 (b) 00110001 (c) 01001000 (d) 00111000
8. The binary number 101100111001010100001 can be written in octal as
(a) 54712308 (b) 54712418(c) 26345218 (d) 231625018

1 The binary number 10001101010001101111 can be written in hexadecimal as (a)AD46716


(b) 8C46F16 (c) 8D46F16 (d) AE46F16
2 The BCD number for decimal 473 is
(a) 111011010 (b) 1110111110101001 (c) 010001110011 (d) 010011110011

1.3 BOOLEAN ALGEBRA AND LOGIC GATES


1.3.1 AND gate
A gate is simply an electronic circuit which operates a one or more signals to produce an
output signal. The output is high only for certain combination of input signals.
An AND gate (Figure
ffd8ffe000104a46494600010101009d009c0000ffdb00430 1.1) has a high output only
00302020302020303030304030304050805050404050a070 when all inputs are high.
706080c0a0c0c0b0a0b0b0d0e12100d0e110e0b0b10161011 The output is low when
13141515150c0f171816141812141514ffdb0043010304040 any one input is low.
5040509050509140d0b0d141414141414141414141414141
414141414141414141414141414141414141414141414141
4141414141414141414141414ffc000110800ad01fc030122
00021101031101ffc4001f000001050101010101010000000
Figure 1.1 AND
0000000000102030405060708090a0bffc400b51000020103
03020403050504040000017d010203000411051221314106
gate
13516107227114328191a1082342b1c11552d1f0243362728
2090a161718191a25262728292a3435363738393a43444546
A
4748494a535455565758595a636465666768696a73747576
B
7778797a838485868788898a92939495969798999aa2a3a4a Boolean expression for AND gate
Y=A.B
5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d
0
3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f operation
is
0
9faffc4001f010003010101010101010101000000000000010
0
2030405060708090a0bffc400b51100020102040403040705 Y=A . B Truth table 1.3.2 OR
0
040400010277000102031104052131061241510761711322
1
328108144291a1b1c109233352f0156272d10a162434e125f
gate
0
11718191a262728292a35363738393a434445464748
1
0
0

A
Y=?
0
ffd8ffe000104a464946000102010
1
060006d0000ffe20c584943435f505
1
An OR gate (Figure 1.2) produces a high output when
24f46494c4500010100000c484c696
0
e6f021000006d6e74725247422058 any or the entire inputs are high. The output is low only
595a2007ce0002000900060031000 when all the inputs are low.
0616373704d534654000000004945
43207352474200000000000000000
00000000000f6d6000100000000d3
Figure 1.2 OR gate
2d485020200000000000000000000
ffd8ffe000104a46494600010201006000600000ffe20c584943435
00000000000000000000000000000
f50524f46494c4500010100000c484c696e6f021000006d6e747252
47422058595a2007ce00020009000600310000616373704d534654 The Boolean expression
00000000000000000000000000000
0000000049454320735247420000000000000000000000000000f6
00000000000000000116370727400
d6000100000000d32d48502020000000000000000000000000000
00015000000033646573630000018
for an OR gate is
00000000000000000000000000000000000000000000000000000
40000006c77747074000001f00000
00000000000000116370727400000150000000336465736300000
0014626b707400000204000000147
Y=A+B
1840000006c77747074000001f000000014626b707400000204000
258595a0000021800000014675859
000147258595a00000218000000146758595a0000022c000000146 Truth table:
5a0000022c000000146258595a000
258595a0000024000000014646d6e640000025400000070646d646
A
0024000000014646d6e6400000254
4000002c400000088767565640000034c000000867669657700000
B
00000070646d6464000002c400000
3d4000000246c756d69000003f8000000146d6561730000040c000
Y=A+B
088767565640000034c0000008676
1.3.3 NOT gate:
0002474656368000004300000000c725452430000043c0000080c6
0
696577000003d4000000246c756d6
75452430000043c0000080c625452430000043c0000080c7465787
0
9000003f8000000146d6561730000
A NOT gate (Figure 1.3) is
400000000436f70797269676874202863292031393938204865776
0
040c0000002474656368000004300
also called an inverter. The
c6574742d5061636b61726420436f6d70616e79000064657363000
0
000000c725452430000043c000008
circuit has one input and
0000000000012735247422049454336313936362d322e310000000
1
0c675452430000043c0000080c625
one output. The output is
00000000000000012735247422049454336313936362d322e31000
1
452430000043c0000080c74657874
the complement of the
000000000000000000000000000000000000000000000000000
1
00000000436f70797269676874202
input. If the input signal is
0
863292031393938204865776c6574
high,
the
output
is
low
and
vice
versa.
1
742d5061636b61726420436f6d706
1
16e79000064657363000000000000
1
00127352474220494543363139363
1
Figure 1.3 NOT gate
62d322e3100000000000000000000
00127352474220494543363139363
62d322e3100000000000000000000
ffd8ffe000104a46494600010201007600760000ffe2The Boolean expression for NOT
00000000000000000000000000000
0c584943435f50524f46494c4500010100000c484c6
00000
gate is
Y=
96e6f021000006d6e74725247422058595a2007ce00
020009000600310000616373704d53465400000000
Truth 494543207352474200000000000000000000000000 table:
00f6d6000100000000d32d485020200000000000000
If two000000000000000000000000000000000000000000 NOT gates are cascaded
then 000000000000000000000000000000000000000116 the output will be same as
370727400000150000000336465736300000184000 input and the circuit is
the
called 0006c77747074000001f000000014626b7074000002 buffer circuit.
04000000147258595a00000218000000146758595a
0000022c000000146258595a000002400000001464
1.3.4 6d6e640000025400000070646d6464000002c40000 NAND gate
0088767565640000034c0000008676696577000003
d4000000246c756d69000003f8000000146d6561730 NAND (Figure 1.4) gate has two
A
or more000040c0000002474656368000004300000000c725 input signals but only one output
signal. 452430000043c0000080c675452430000043c000008All input signals must be high to
get a0c625452430000043c0000080c74657874000000004low output. When one AND gate
36f7079726967687420286329203139393820486577
is
combined with a NOT gate, a
6c6574742d5061636b61726420436f6d70616e79000
064657363000000000000001273524742204945433
6313936362d322e310000000000000000000000127
35247422049454336313936362d322e31000000000
000000000000000000000000000000000000000000
000

NAND gate is obtained.


Truth table:

Figure 1.4 NAND gate

1.3.5 NOR gate:


NOR gate (Fig.
ffd8ffe000104a4649460001010100bf00d00000ffdb00430003020203020203
1.5) has two or
03030304030304050805050404050a070706080c0a0c0c0b0a0b0b0d0e12100
input
d0e110e0b0b1016101113141515150c0f171816141812141514ffdb004301030 more
40405040509050509140d0b0d1414141414141414141414141414141414141 signals and one
41414141414141414141414141414141414141414141414141414141414141 output signal. It
ffd8ffe000104a46494600010101009d00c80000ffdb00430
4ffc000110800ad034103012200021101031101ffc4001f00000105010101010 consists of one
00302020302020303030304030304050805050404050a070
gate
10100000000000000000102030405060708090a0bffc400b510000201030302 OR
706080c0a0c0c0b0a0b0b0d0e12100d0e110e0b0b10161011
followed
by
an
0403050504040000017d010203000411051221314106135161072271143281
13141515150c0f171816141812141514ffdb0043010304040
A
91a1082342b1c11552d1f02433627282090a161718191a25262728292a34353 inverter.
5040509050509140d0b0d141414141414141414141414141
NOR
gate
63738393a434445464748494a535455565758595a636465666768696a737475
A
414141414141414141414141414141414141414141414141
produces a high
767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2
B
4141414141414141414141414ffc000110800ad01fc030122
output
only
b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e
____ Y = A . B
00021101031101ffc4001f000001050101010101010000000
when all the
7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f01000301010101010101010100000000
0
0000000000102030405060708090a0bffc400b51000020103
00000102030405060708090a0bffc400b511000201020404030407050404000
inputs are low.
0
03020403050504040000017d010203000411051221314106
10277000102031104052131061241510761711322328108144291a1b1c10923
1
13516107227114328191a1082342b1c11552d1f0243362728
3352f0156272d10a162434e125f11718191a262728292a35363738393a434445
0
2090a161718191a25262728292a3435363738393a43444546
464748
1
4748494a535455565758595a636465666768696a73747576
1
7778797a838485868788898a92939495969798999aa2a3a4a
1
5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d
0
3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f
1
9faffc4001f010003010101010101010101000000000000010
1
2030405060708090a0bffc400b51100020102040403040705
1
040400010277000102031104052131061241510761711322
0
328108144291a1b1c109233352f0156272d10a162434e125f
11718191a262728292a35363738393a434445464748
Figure 1.5 NOR gate Truth table:

_____ Y = A + B

1.3.6 XOR gate

XOR (Figure 1.6) gate is an abbreviation of exclusive OR gate. It has two inputs and one
output. For a two input XOR gate, the output is high when the inputs are different and the
output is low when the inputs are same. In general, the output of an XOR gate is high when the
number of its high inputs is odd. The Boolean expression of the XOR gate is _ _
Y = A.B + A.B

a) Logic diagram

b) Logic symbol:

Figure 1.6 XOR gate

ffd8ffe000104a46494600010201008500850000ffe20c584943435f50524f46494c4500010100000c4
84c696e6f021000006d6e74725247422058595a2007ce00020009000600310000616373704d534654
0000000049454320735247420000000000000000000000000000f6d6000100000000d32d485020200
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000001163707274000001500000003364657363000001840000006c77747074000001f000
000014626b707400000204000000147258595a00000218000000146758595a0000022c00000014625
8595a0000024000000014646d6e640000025400000070646d6464000002c400000088767565640000
034c0000008676696577000003d4000000246c756d69000003f8000000146d6561730000040c00000
02474656368000004300000000c725452430000043c0000080c675452430000043c0000080c625452
430000043c0000080c7465787400000000436f70797269676874202863292031393938204865776c6
574742d5061636b61726420436f6d70616e7900006465736300000000000000127352474220494543
36313936362d322e31000000000000000000000012735247422049454336313936362d322e3100000
ffd8ffe000104a46494600010201006d006d0000ffe20c584943435f
0000000000000000000000000000000000000000000000000
50524f46494c4500010100000c484c696e6f021000006d6e74725247
ffd8ffe000104a46494600010201006400640000ffe20c584943435f
422058595a2007ce00020009000600310000616373704d534654000
50524f46494c4500010100000c484c696e6f021000006d6e74725247
0000049454320735247420000000000000000000000000000f6d600
422058595a2007ce00020009000600310000616373704d534654000
0100000000d32d48502020000000000000000000000000000000000
0000049454320735247420000000000000000000000000000f6d600
0000000000000000000000000000000000000000000000000000000
0100000000d32d48502020000000000000000000000000000000000
0000001163707274000001500000003364657363000001840000006
0000000000000000000000000000000000000000000000000000000
c77747074000001f000000014626b70740000020400000014725859
0000001163707274000001500000003364657363000001840000006
5a00000218000000146758595a0000022c000000146258595a00000
c77747074000001f000000014626b70740000020400000014725859
24000000014646d6e640000025400000070646d6464000002c40000
5a00000218000000146758595a0000022c000000146258595a00000
0088767565640000034c0000008676696577000003d4000000246c7
24000000014646d6e640000025400000070646d6464000002c40000
56d69000003f8000000146d6561730000040c000000247465636800
0088767565640000034c0000008676696577000003d4000000246c7
0004300000000c725452430000043c0000080c675452430000043c0
56d69000003f8000000146d6561730000040c000000247465636800
000080c625452430000043c0000080c7465787400000000436f7079
0004300000000c725452430000043c0000080c675452430000043c0
7269676874202863292031393938204865776c6574742d5061636b6
000080c625452430000043c0000080c7465787400000000436f7079
1726420436f6d70616e790000646573630000000000000012735247
7269676874202863292031393938204865776c6574742d5061636b6
422049454336313936362d322e31000000000000000000000012735
1726420436f6d70616e790000646573630000000000000012735247
247422049454336313936362d322e31000000000000000000000000

A
B
Y=AB
0
Truth table:0
0
0
1
Uses of XOR
1 gate:
1
1. Binary to0Gray Converter
1
1
Figure 1.7 Binary to Gray Converter
1
The Figure 0
1.7 shows the way to convert binary number to gray number using XOR gates.
Since mod-2 addition is involved in the conversion, XOR gate is used for this purpose.
ffd8ffe000104a46494600010101007800910000ffdb004300030202
0302020303030304030304050805050404050a070706080c0a0c0c0 2. Gray to Binary
b0a0b0b0d0e12100d0e110e0b0b1016101113141515150c0f171816 Converter:
141812141514ffdb00430103040405040509050509140d0b0d14141
4141414141414141414141414141414141414141414141414141414XOR gate is also used
1414141414141414141414141414141414141414ffc000110801260 to convert gray code to
1c003012200021101031101ffc4001f0000010501010101010100000 a binary number. The
000000000000102030405060708090a0bffc400b510000201030302 circuit diagram for this
0403050504040000017d01020300041105122131410613516107227operation is shown in
114328191a1082342b1c11552d1f02433627282090a161718191a25 the Figure 1.8.
262728292a3435363738393a434445464748494a535455565758595
a636465666768696a737475767778797a838485868788898a929394
95969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5
c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f Figure 1.8 Gray to
Binary Converter
6f7f8f9faffc4001f0100030101010101010101010000000000000102
030405060708090a0bffc400b511000201020404030407050404000
10277000102031104052131061241510761711322328108144291a1
b1c109233352f0156272d10a162434e125f11718191a262728292a35
363738393a434445464748

3. Parity checker:
Parity checker can be designed using XOR gates as given in the Figure 1.9. Here the parity of
the word ABCD is checked. The circuit adds the bits of ABCD. A final sum of 0 implies even
parity and a sum of 1 means odd parity.
ffd8ffe000104a464946000102010092009200
Figure 1.9 Parity checker
00ffe20c584943435f50524f46494c450001010
0000c484c696e6f021000006d6e74725247422
058595a2007ce000200090006003100006163
73704d5346540000000049454320735247420 1.3.7 Basic Laws of Boolean Algebra
000000000000000000000000000f6d6000100
000000d32d485020200000000000000000000 Commutative law:
0000000000000000000000000000000000000
A+B=B+AB+A=A+B
0000000000000000000000000000000000000
0116370727400000150000000336465736300
0001840000006c77747074000001f00000001 Associative law:
4626b707400000204000000147258595a0000
A + (B + C) = (A + B) + C
0218000000146758595a0000022c000000146
258595a0000024000000014646d6e64000002
A. (B.C) = (A.B).C
5400000070646d6464000002c400000088767
565640000034c0000008676696577000003d4 Distributive law
000000246c756d69000003f8000000146d656
1730000040c00000024746563680000043000
A. (B + C) = A.B + A.C
00000c725452430000043c0000080c6754524
30000043c0000080c625452430000043c0000 Other laws of Boolean algebra:
080c7465787400000000436f7079726967687
4202863292031393938204865776c6574742d 1 A + 0 = A
5061636b61726420436f6d70616e790000646
5736300000000000000127352474220494543 2 A + 1 = 1
36313936362d322e310000000000000000000
00012735247422049454336313936362d322e 3 A + A = A
3100000000000000000000000000000000000
4A+=1
0000000000000000000
5 A .0 = 0

6 A .1 = A
ffd8ffe000104a46494600010201007e007e0000ffe20c5849
43435f50524f46494c4500010100000c484c696e6f021000007 A .A = A
6d6e74725247422058595a2007ce000200090006003100006
16373704d534654000000004945432073524742000000000 8 A . = 0 =
0000000000000000000f6d6000100000000d32d485020200
000000000000000000000000000000000000000000000000 9 A = A
000000000000000000000000000000000000000000000116
10 A + A.B =A
3707274000001500000003364657363000001840000006c7
7747074000001f000000014626b707400000204000000147 11 A.(A + B) = A
258595a00000218000000146758595a0000022c000000146
258595a0000024000000014646d6e6400000254000000706 12 (A + B).(A+C) = A + B.C
46d6464000002c400000088767565640000034c000000867
6696577000003d4000000246c756d69000003f8000000146d13 A + .B =A + B
6561730000040c0000002474656368000004300000000c72
5452430000043c0000080c675452430000043c0000080c62514 A.( +B) = A.B
452430000043c0000080c7465787400000000436f70797269 15 (A + B).( + C) = A.C + .B
676874202863292031393938204865776c6574742d506163
6b61726420436f6d70616e790000646573630000000000000
012735247422049454336313936362d322e3100000000000
0000000000012735247422049454336313936362d322e310
000000000000000000000000000000000000000000000000
00000

16 (A + C).( + B) = A.B + .C

1.3.8 De Morgans Theorems: I Theorem


statement:
The complement of a sum is equal to the product of the complements. A + B = A . B
II Theorem Statement:
The complement of a product is equal to the sum of the complements.
A.B= A+B
Proof of first theorem:
_____ _ _ To prove
B

A+B= A.

Case 1: A=0, B=0 _____ _____ _


L.H.S => A + B = 0 + 0 = 0 = 1 _ _ _ _
R.H.S => A . B = 0 . 0 = 1 .1 = 1
Case 2: A=0, B=1

_____ _____ _
L.H.S => A + B = 0 + 1 = 1 = 0 _ _ _ _
R.H.S => A . B = 0 . 1 = 1 .0 = 0
Case 3: A=1, B=0 _____ _____ _
L.H.S => A + B = 1 + 0 = 1 = 0 _ _ _ _
R.H.S => A . B = 1 . 0 = 0 .1 = 0
Case 4: A=1, B=1 _____ _____ _
L.H.S => A + B = 1 + 1 = 1 = 0 _ _ _ _
____
R.H.S => A . B = 1 . 1 = 0 .0 = 0
__
A
B
Truth table _
A.B
Proof of second theorem:
____
A +_B_ To prove A . B = A + B
0
0
Case 1: A=0, B=0
1 ____ ___ _
L.H.S => A . B1= 0 . 0 = 0 = 1 _ _ _ _
R.H.S => A +0B = 0 + 0 = 1 + 1 = 1
1
0
0 ____ ____ _
Case 2: A=0, B=1
L.H.S => A . B1= 0 . 1 = 0 = 1 _ _ _ _
0
0
0
1
1
0
0

R.H.S => A + B = 0 + 1 = 1 + 0 = 1
Case 3: A=1, B=0 ____ ____ _
L.H.S => A . B = 1 . 0 = 0 = 1 _ _ _ _
R.H.S => A + B = 1 + 0 = 0 +1 = 1
Case 4: A=1, B=1 ____ ____ _
____
L.H.S => A . B = 1 . 1 = 1 = 0 _ _ _ _
__
R.H.S => A + B = 1 + 1 = 0 +0 = 0
A
B
_
Truth table
A+B
A.B

CHECK YOUR PROGRESS 2

0
1. An inverter 0
performs an operation known as
1
(a) Complementation
(b) assertion
1 both answers (a) and (c) 2.The output of gate is LOW when at least one of its
(c) Inversion (d)
0 It is true for
inputs is HIGH.
1
(a) AND (b) 1NAND (c) OR (d) NOR 3.The output of gate is HIGH when at least one of
its inputs is LOW.
1 It is true for
1
0
(a) AND (b) 1OR (c) NAND (d) NOR
1
1
1 a gate is HIGH if and only if all its inputs are HIGH. It is true for (a)XOR (b)
4.The output of
0 NAND
AND (c) OR (d)
0
5. The output of a gate is LOW if and only if all its inputs are HIGH. It is true for (a)AND (b)
XNOR (c) NOR (d) NAND
6.Which of the following gates cannot be used as an inverter?

(a)NAND (b) AND (c) NOR (d) None of the above


7.The complement of a variable is always
(a) 0 (b) 1 (c) equal to the variable (d) the inverse of the variable 8.Which one of the following
is not a valid rule of Boolean algebra?
(a) A + 1 = 1 (b) A = (c) A.A = A (d) A + 0 = A
9. Which of the following rules states that if one input of an AND gate is always 1 , the output
is equal to the other input ?
(a) A + 1 = 1 (b) A + A = A (c) A.A = A (d) A . 1 = A

11.4

SUMMARY

A binary number is a weighted number in which the weight of each whole number digit is a
ppositive power of 2 and the weight of each fractional digit is a negative power of 2.
The 1s complement of a binary number is derived by changing 1s to 0s and 0s to 1s
T
The 2s complement of a binary number can be derived by adding 1 to the 1s complement.
T
The octal number system consists of eight digits, 0 through 7.
T
The hexadecimal number system consists of 16 digits and characters, 0 through 9 followed by
A through F.
The ASCII is a 7-bit alphanumeric code that is widely used in computer systems for
iinput/output of information.
The output of an inverter is the complement of its input
T
The output of an AND gate is high only if all the inputs are high
T
The output of an OR gate is high if any of the inputs is high
T
The output of an NOR gate is low if any of the inputs is high
T
The output of an NAND gate is low only if all the inputs are high
T
The output of an exclusive-OR gate is high when the inputs are not the same

1.5 GLOSSARY
Alphanumeric : Consisting of numerals, letters, and other characters.
ASCII : American Standard Code for Information Interchange.
BCD : Binary Coded Decimal ; a digit code in which each of the decimal digits , 0 through 9,
is represented by a group of four bits.
Binary : Describes a number system that has a base of two and utilizes 1 and 0 as its digits.
Boolean algebra : The mathematics of logic circuits.

Gate : A logic circuit that performs a specified logic operation , such as AND, OR or NOT.
Hexadecimal : Describes a number system with a base of 16
Octal : Describes a number system with a base of 8. Parity : Parity is based on the number of
1s in a binary word. If the number of 1s in a word is odd, then it is a odd parity word and if
the number of 1s is even, then it is an even parity word.
Truth table : A table showing the inputs and corresponding output levels of a logic circuit.
Universal gate : Either a NAND gate or a NOR gate.

1.6 REFERENCES
1.Moris Mano, Digital Computer Fundamentals TMH 3rd Edition
2.Thomas C Bartee Computer Architecture and Logic and logic Design TMH
3.Malvino and Leech Digital Principles and Applications, TMH

4.Thomas L.Floyd Digital fundamentals Pearson Education 8th Edition

1.7 ANSWERS TO CHECK YOUR PROGRESS QUESTIONS


Check Your Progress 1 1.(d) 2.(a) 3.(c) 4.(a) 5.(d) 6.(b) 7.(d) 8.(b) 9.(c) 10.(c) Check Your
Progress 2 1.(d) 2.(d) 3.(c) 4.(b) 5.(d) 6.(b) 7.(d) 8.(b) 9.(d)

You might also like