You are on page 1of 23

MODULE I

INTRODUCTION TO DIGITAL SYSTEMS

Lesson 1 Number System

Lesson 2 lntroduction to Logic


Gates

Lesson 3 Boolean Algebra


Theorems

EEAC 109lvlodute I

-
6

MODULE I

INTRODUCTION TO DIGITAL SYSTEMS

INTRODUCTION

The commercial avaitabitity of devices using digitat technotogy to


receive, manipulate, and transmit information seems to have exptoded. Cett
phones and handheld devices of various kinds offer new, competing features
almost daity. Underneath the attractive graphicat user interface of att of
these devices sits a digitat system that processes data in a binary format.
The theoretical foundations of these systems have not changed much;
indeed, one coutd argue that the stabitity of the core theory, coupted with
modern design tools, has promoted the widespread response of
manufacturers to the opportunities of the marketptace.
This modute provides a review of number system, coding and Bootean
Atgebra.

OBJECTIVES

After studying the modute, you shoutd be abte to:

1. Famitiarize yoursetf to digitat systems.


2. Recatt the number system.
3. Define Logic Gates.
4. Demonstrate through examptes the Bootean atgebra theorems.

d DrREcroNs/ M.DULE ,RGANTZER

There are three tessons in the module. Read each lesson carefutty
then ans,wer the exercises/activities to find out how much you have
benefited from it. Work on these exercises carefulty and submit your output
to your instructor or to the COE office.

ln case you encounter difficutty, contact your instructor.

Good luck and happy reading!!!

EEAC 109 lvtodute I


7

Lesson 1

Number System

Digital systems have such a prominent rote in everyday life that we


refer to the present technological period as the digitol age. Digital systems
are used in communication, business transactions, traffic control, spacecraft
guidance, medical treatment, weather monitoring, the lnternet, and many
other commercial, industrial, and scientific enterprises. We have digital
telephones, digitaI tetevisions, digitaI versatite discs, digitat cameras,
handhetd devices, and, of course, digitat computers. We enjoy music
downtoaded to our portable media player (e.g., iPod Touch*) and other
handheld devices having high resolution disptays. These devices have
graphical user interfaces (GUls), which enabte them to execute commands
that appear to the user to be simple, but which, in fact, invotve precise
execution of a sequence of complex internal instructions. /l ost, if not at[, of
these devices have a speciat-purpose digitat computer embedded within
them. The most striking property of the digitat computer is its generatity. lt
can fottow a sequence of instructions, catted a program, that operates on
given data. The user can specify and change the program or the data
according to the specific need. Because of this ftexibitity, general-purpose
digitat computers can perform a variety of information-processing tasks that
range over a wide spectrum of applications.
One characteristic of digital systems is their abitity to represent and
maniputate discrete elements of information. Any set that is restricted to a
finite number of etements contains discrete information. Examples of
discrete sets are the 10 decimal digits, the 26 letters of the atphabet, the
52 ptaying cards, and the 64 squares of a chessboard. Early digital
computers were used for numeric computations. ln this case, the discrete
elements were the digits. From this application, the term digitol computer
emerged. Discrete etements of information are represented in a digitat
system by physical quantities catled signats. Etectrical signats such as
voltages and currents are the most common. Electronic devices calted
transistors predominate in the circuitry that implements these signats. The
signats in most present-day etectronic digital systems use just two discrete
vatues and are therefore said to be binary. A binary digit, catted a bit, has
two values: 0 and 1. Discrete elements of information are represented with
groups of bits calted binary codes. For example, the decimal digits 0 through
9 are represented in a digital system with a code of four bits (e.g., the
number 7 is represented by 01 11). How a pattern of bits is interpreted as a
L number depends on the code system in which it resides. To make this
distinction, we could write (01110 to indicate that the pattern 01't 1 is to be
interpreted in a binary system, and (0111)ro to indicate that the reference
system is decimat. Then 01112 = 7ro , which is not the same as 011110 , or
one hundred eleven. The subscript indicating the base for interpreting a
pattern of bits witt be used onty when ctarification is needed. Through

EEAC 109 Artodute I


8

various techniques, groups of bits can be made to represent discrete


symbols, not necessarity numbers, which are then used to devetop the
system in a digitat format. Thus, a digital system is a system that
maniputates discrete elements of information represented internalty in
binary form. ln today's technology, binary systems are most practical
because, as we wi[[ see, they can be imptemented with etectronic
components. Discrete quantities of information either emerge from the
nature of the data being processed or may be quantized from a continuous
process. On the one hand, a payroll schedute is an inherently discrete
process that contains emptoyee names, social security numbers, weekly
salaries, income taxes, and so on. An emptoyee's paycheck is processed by
means of discrete data values such as letters of the atphabet (names), digits
(satary), and special symbols (such as S). On the other hand, a research
scientist may observe a continuous process, but record only specific
quantities in tabular form. The scientist is thus quantizing continuous data,
making each number in his or her table a discrete quantity. ln many cases,
the quantization of a process can be performed automatica[y by an
ana[og-to-digitat converter, a device that forms a digitat (discrete)
representation of an analog (continuous) quantity.

Binary Numbers
A decimal number such as 7,392 represents a quantity equal to 7
thousands, ptus 3 hundreds, plus 9 tens, ptus 2 units. The thousands,
hundreds, etc., are powers of 10 imptied by the position of the coefficients
(symbots) in the number. To be more exact, 7,392 is a shorthand notation
for what shoutd be written as

7' 103 + 3.102 + 9.101 + 2.100

However, the convention is to write onty the numeric coefficients


and, from their position, deduce the necessary powers of 10 with powers
increasing from right to [eft. ln generat, a number with a decimat point is
representd by a series of coefficients:

a5a4a3a2a1ao. a.1a-2a,3

The coefficients o, are any of the 10 digits (0, 1,2, . .., 9), and the
subscript vatue j gives the ptace vatue and, hence, the power of 10 by which
the coefficient must be muttiptied. Thus, the preceding decimat number can
be expressed as

105a5 + lffq. + 103a: + 102o2 + 101q + 1 00oo + 10-1a,r + lQ'2s., a lQ.zs.,

with o: = 7, a= 3, or = 9, and oo= 2.

The decimal number system is said to be of base, or radix, 10


because it uses 10 digits and the coefficients are muttiptied by powers of 10.
fhe binorysystem is a different number system. The coefficients of the
binary number system have onty two possibte vatues: 0 and .1. Each

,I
EEAC 09 A,todule I
9

coefficient al is muttiptied by a power of the radix, e.9., I , and the resutts


are added to obtain the decimal equivatent of the number. The radix point
(e.9., the decimal point when 10 is the radix) distinguishes positive powers
of 10 from negative powers of 10. For exampte, the decimat equivalent of
the binary number 11010.11 is 26.75, as shown from the multiptication of
the coefficients by powers of 2:

1*24 +1r.23+ 0*22+ 1*21 + 0*20+,1 *21 +'1 .2.2=26.75

There are many different number systems. ln general, a number expressed


in a base-r system has coefficients multiplied by powers of r:

or.la + On.t.latl + . . . + ggol2 + O1.f + Qo + O.tf1


+O-2.f7+.,.+g-rn.l-n

The coefficients oj range in vatue from 0 to r - 1. To distinguish between


numbers of different bases, we enclose the coefficients in parentheses and
write a subscript equal to the base used (except sometimes for decimat
numbers, where the content makes it obvious that the base is decimat). An
exampte of a base-5 number is

(4021 .2)s = 4 * 53 + 0.52 +2 * 51 + 1 * 50 + 2 * 5'1 = (511.4)ro


The coefficient vatues for base 5 can be onty 0, '1, 2, 3, and 4. The octat
number system is a base-8 system that has eight digits: 0, 1, 2, 3, 4, 5, 6, 7.
An example of an octa[ number is 127.4. fo determine its equivatent
decimal vatue, we expand the number in a power series with a base of 8:

(127.4)a='l " * *
82 + 2 81 + 7 80 + 4' 8'1 = (87.5)10

Note that the digits 8 and 9 cannot appear in an octal number. lt is


customary to borrow the needed r digits for the coefficients from the
decimal system when the base of the number is less than 10. The letters of
the alphabet are used to supplement the 1O decimal digits when the base
of the number is greater than 1O. For example, in the hexodecimol
(base-16) number system, the first 10 digits are borrowed from the decimat
system. The letters A, B, C, D, E, and F are used for the digits 10, ,11,12, 13,
14, and 15, respectively. An example of a hexadecimat number is

(865F)16 -- 11 - 163 + 6. 162 + 5. + 15 .


161 160 = (46,687y0

The hexadecimal system is used commonty by designers to represent long


strings of bits in the addresses, instructions, and data in digitat systems. Foi
exampte, B65F is used to represent 101 101 10010j 0000.
As noted before, the digits in a binary number are calted bits. When a
bit is equal to 0, it does not contribute to the sum during the conversion.
Therefore, the conversion from binary to decimat can be obtained by adding
onty the numbers with powers of two corresponding to the bits lhat are
equal to 1. For example,
10

(110101), = 32 +'16a { +! = (!l)16

There are four 1's in the binary number. The corresponding decimal number
is the sum of the four powers of two. Zero and the first 24 numbers obtained
from 2 to the power of n are tisted in Tabte 1.1 . ln computer work, 210 is
referred to as K (kito), 220 as M (mega), 2r0 as G (giga), and 2{ as T (tera).
Thus, 4K = 217 = 4,096 and 16M = 274 = 16,777,216. Computer capacity is
usuatty given in bytes. A byte is equal to eight bits and can accommodate
(i.e., represent the code of) one keyboard character. A computer hard disk
with four gigabytes of storage has a capacity of 4G = 232 bytes
(approximately 4 bittion bytes). A terabyte is 1024 gigabytes, approximately
1 trittion bytes. Arithmetic operations with numbers in base r fottow the
same rutes as for decimal numbers. When a base other than the familiar
base 10 is used, one must be careful to use only the r-altowabte digits.
Examptes of addition, subtraction, and multiptication of two binary numbers
are as foltows:

augL'nd: l0l l0l ttintr.'ntl: l()l l()l rnultiplic nd l0tl


ltldcntl: - l(X)l ll su lrt 1;111g111 -l()lrlll nrult igrlicr: x l0l
sunl: l{)l(}l(x) dillcrcncr.: 0(x)llo l0l t
(xIxr
par tial ploduct: t0l I
Product: l tol I I

Table l.l
Powers of Two
n 2' n 2n n 2'
0 I ll l.i6 l(r 65.536
I l 9 5ll l7 l-11.072
l .t l() Lr)l-l (IK lrl 16l.l4.l
l( l.rNri l(, 52.1..1t{s
l l6 tl 4.rF)6 (4K) l(l l.(H{.576 ( ilVl )
5 11 t-l s. te2 lt l.(rr7l5l
6 (rJ IJ t6.-1r{.1 t: .1.t9{.3{B
7 lls t-i -l:.76,\ l.i ,\.3t{s.flr\

The sum of two binary numbers is catcutated by the same rutes as in


decimal, except that the digits of the sum in any significant position can be
only 0_or 1. Any carry obtained in a given significanl position is used by the
pair of digits one significant position higher. Subtraction is stightty more
complicated. The rutes are sti[[ the same as in decimat, except that the
borrow in a given significant position adds 2 to a minuend digit. (A borrow in

EEAC 109 l,{odute I


11

the decimal system adds 10 to a minuend digit.) Muttiptication is simpte:


The muttiptier digits are atways 1 or 0; therefore, the partial products are
equal either to a shifted (teft) copy of the multipticand or to 0.

Number Base Conversion


Representations of a number in a different radix are said to be
equivatent if they have the same decimal representation. For example,
(0011)a and (1001 )z are equivatent-both have decimal value 9. The
conversion of a number in base r to decimal is done by expanding the
number in a power series and adding att the terms as shown previously. We
now present a general procedure for the reverse operation of converting a
decimal number to a number in base r. lf the number includes a radix point,
it is necessary to separate the number into an integer part and a fraction
part, since each part must be converted differently. The conversion of a
decimal integer to a number in base r is done by dividing the number and alt
successive quotients by r and accumutating the remainders. This procedure
is best illustrated by exampte.

EXAMPLE 1.1
(irnvert dccinrll -ll t() hilar\: Firsl. -ll is dividc-d br. I to [ive irn inl!.qcr qu()tienl ol 2{}
aml a rcnrainttcr of|. Thc'n thc quotient is aeain dirid.rl hi.l lo tivc a ncs, qur)ticnr nd
rrnraindct. Thc prft'css is continu!-d urltil thc int('gcr quotienl bccomes O. Th!' .t,.,lh<.it ts
o[ thc dcsired binary numr-$[ at! ohtained frorrr lhc r.,r ,rr)lrt rr as frrlhrus:

lnlcget Rernuilldca ('0r[licirtll


QuotieDl
lt/ 2 lll "t-
:I
20/ : ll) + (,
tnl o 02:{l
+ 1 gt: I
l
) l) + 0
t/2 0 I
Ther!'fore. thc answer is(.ll)6 : ktstt(tytz t.to)7: (l0llxllh.

The alithmetic pr(xess can bc mitnipulalcd more convenienllv as [ollows:


lnlegcr Remalnder
ll
l0 I
lll 0
) o
2 I
I 0
0 I lolfi)l : answcr
( i)n\ e [\i()n t ()m ducintal i ntcgcr s to ilnv hase-r svstenr is sinrillu I., t his cx:lnrplc. exc!'pt
lhut division is done hl r instear.l o[ f.

EEAC 109 l\ odute I


12

EXAMPLE 1.2
('onvc'r'l decinral l5J to oclal. Thc rc-quircd base. r is S. First. l-i-i is divitlcd lrv S 1o qivc
:rn inleg.cr quoticnt ttf l9lntl a rcmairtder of l.'ften l9 is dividetl lrv S lo sivc ln integcr
quolicnt of ) and a tenrainder of -i. Finallr'.2 is divitletl h1, N to givc. a tluoticnl of 0 and
{r rr'maindcr of 2. This process can hc convL.nientlt' mlnipulated as lollows:

l-5-l

l9 I

2 -1

o 2 : (231)t
The convt'rsion o[ a dccin,al ti'ttttitttt to lrinarv is accomplishcd lrv a mcthod sinrilar
to that uscd for intc'qer:r Howevct. nrultiplication is used instc'ad of division. and irrtegcrs
instcad of rcnrainders arc accumulatt'd. Again. thc method is r^usl explaincd tr-v c'xantplc.
I
OCTAL AND HEXADECII,IAL
The conversion from and to binary, octal, and hexadecimat ptays an
important role in digitat computers, because shorter patterns of hex
characters are easier to recognize than long patterns of 1's and 0's. Since 23
= 8 and 2a = 16, each octal digit corresponds to three binary digits and each
hexadecimat digit corresponds to four binary digits. The first 16 numbers in
the decimat, binary, octal, and hexadecimal number systems are tisted in
Tabte 1.2 . The conversion from binary to octal is easity accomptished by
partitioning the binary number into groups of three digits each, starting
from the binary point and proceeding to the teft and to the right. The
corresponding octal digit is then assigned to each group. The fottowing
exampte ittustrates the procedure:

( ilr Il0 0()l lol ()lI III l(n fiX) ll0;, : (26153.7-t()d)x
26153 74t) 6

Trblc l2
Numbers with Dltferpnt Eoses

Declmal Blnary O(tal Herade<lmal


(base l0) (bare 2) (hase 8) (bare l6)
(Nt { }(x,{ ) 0l) 0
(,I 0txrI () I I
(,2 r)0 1 (, ol l
0-1 rlr) I I I l-i -l
(H {ll0{) { }:l I
0-5 () l() I r )-5
-5
(Xr 0Il{) 06 6
07 0llt [7 7
()fi Irxr) l(l ri
01, Irx, I lt I
l(| l()t0 l2 A
lt l()l I l-i B
l2 I l(xl l.l C
1,1 I l()t I5 t)
t{ II l() l6 E
t5 lill t7 F

EEAC 109
13

Conversion from binary to hexadecimal is simitar, except that the binary


number is divided into groups of /our digits:

(10 llll{r tll l{} l0l I Illl {xrll)). : (l('6B.Fl)rr


I (' 6 B F l
The corresponding hexadecimal (or octat) digit for each group of binary
digits is easily remembered from the values tisted in Tabte 1.2. Conversion
from octal or hexadecimal to binary is done by reversing the preceding
procedure. Each octal digit is converted to its three-digit binary equivalent.
Simitarty, each hexadecimat digit is converted to its four-digit binary
equivatent. The procedure is ilustrated in the following examptes:
(67-1.lll)s : (ll{) llt 0lt 0{}l (}l(} l{xt),
6l -1 llJ
It n,.l

(,ilr'.D)16 : (l}llll lxl{l(} 0l l0 I l(rl),


0 6 t)

Complements of Numbers
Given a number N in base r having n digits, the (r - 'l )'s complement
of tl, i.e., its diminished radix complement, is defined as (r - 1) - N. For
decimal numbers, r = 10 and r - 1 = 9,so the 9's comptement of Nis (10n -
1) - N. ln this case, 10, represents a number that consists of a singte 1
fottowed by n 0's. ('10" - 1) is a number represented by n 9,s. For example, if
n = 4, we have1@ = 10,000 and lff - 1 = 9999. tt follows that the 9's
complement of a decimal number is obtained by subtracting each digit from
9. Here are some numerica[ examptes:

The 9',s comptemenr of 546700 is 999999 - 546700 = 453299.


The 9's comptement of 012398 is 999999 - 012398 = 987601 .

For binary numbers, r= 2 and r - 1= 1, so the 1's complement of Nis (2n -


1) - N. Again, 2n is represented by a binary number that consists of a 1
fottowed by n 0's. 2n - 1 is a binary number represented by n 1's. For
exampte, if n = 4, we have 2+ = (10000)z and 2a - I = (1111\2. Thus, the 1,s
complement of a binary number is obtained by subtracting each digit from
1. However, when subtracting binary digits from 1, we can have either 1 - 0
= 1 or 1 - 'l = 0, which causes the bit to change from 0 to 1 or from .l to 0,
respectively. Therefore, the I's complement of a binary number is formed
by changing 'l's to O's and O's to 1 ,s. The fottowing are some numerical
examptes:

The 1 's complement of 1 01 1 000 is 01001 1 1 .


The 'l 's comptement of 01 01 101 is 101 0010.

Th.e (r - 'l )'s complement of octal or hexadecimal numbers is obtained by


subtracting each digit from 7 or F (decimat '15), respectivety.
14

Radix Complement
The r's comptement of an n-digit number N in base r is defined as l. - N for
N*0 and as 0 for N = 0. Comparing with the (r - 1)'s comptement, we note
that the r's comptement is obtained by adding 1 to the (r - 1)'s
comptement, since r{' - N = [(r. - 1) - M + 1. Thus, the 10's comptement of
decimal 2389 is 7610 + 1 = 7611 and is obtained by adding 1 to the 9's
comptement value. The 2's complement of binary 101100 is 010011 + 1 =
010100 and is obtained by adding 1 to the 1's-comptement vatue. Since 10 is
a number represented by a 1 followed by n 0's, 10, - N, which is the 10,s
complement of N, can be formed atso by leaving att least significant 0's
unchanged, subtracting the first nonzero teast significant digit from 10, and
subtracting att higher significant digits from 9. Thus,

the 10's comptement of 012398 is987602

the 10's .orpt"*#dof Zq6l00is 753300

The 10's comptement of the first number is obtained by subtracting 8 from


19 ln the least significant position and subtracting att other digits from 9.
The 10's comptement of the second number is obtained by teavlng the two
[east significant 0's unchanged, subtracting 7 from 10, and subtratting the
9the1 three digits froy 9. simitarty, the 2's complement can be formed by
leaving at[ teast significant 0's and the first 1 unchanged and reptacing 1,i
with 0's and 0's with 1's in atl other higher significant cigits. For exampfe,

the 2's complement of 1101100 is 0010100

the 2's comptemerilf o, fi1l1is 1001001

T-he.]'s complement of the first number is obtained by leaving the two least
significant 0's and the first 1 unchanged and then repiacing 1;s with 0,s and
0's with 1 's in the other four most silnificant digits.'The 2;s comptement of
the second number is..obtained by telving the teast significant 1 Lnchanged
and complementing a[[ other digits.
In the previous definitions, it was assumed that the numbers did not
have a radix point. lf the originat number N contains a radix point, the point
shoutd be removed.temporarity in order to form the ris or (r 1),s -
comptement. The radix point is then restored to the comptementd number
in the same retative position. lt is also worth mentioning that the
complement of the complement restores the number to Its original
value. To see this relationship, note that the r,s complement of N is rri- N,
so that the comptement of the comptement is 14 - (r, - N) = N and is equal to
the original number.

Subtraction with Complements


The direct method of subtraction taught in etementary schoots uses
the.borrow concept. ln this method, we borrow a 1 from a hig'her significint
position when the minuend digit is smaller than the subtrah.-end
Oi'git. The

EEAC 109 li,lodute I


15

method works wetl when peopte perform subtraction with paper and pencil.
However, when subtraction is implemented with digitat hardware, the
method is less efficient than the method that uses comptements. The
subtraction of two n-digit unsigned numbers l,t - N in base r can be done as
follows:

1. Add the minuend l1 to the r's complement of the subtrahend N.


Mathematically, ll + (r' - N) =l,t - N+rn.
2. lf N > N, the sum wi[[ produce an end carry r n, which can be
discarded; what is left is the resutt l,l - N.
3. lf l1 . N, the sum does not produce an end carry and is equal to ra -
(N - l,t), which is the r's comptement of (N - /U). To obtain the answer
in a familiar form, take the r's comptement of the sum and place a
negative sign in
front. The fotlowing examptes ittustrate the
procedure:

EXAMPLE I.5
Using l0's complement, subtrrcl 72532 - 3250.

M: 72532
l0's complement of N= " f!!
Sum = 169?f'2
Discard end carrv lG< = - IIIXXX)
Answer = 692112

Note that Mhas (i}€ disits and Nhas only four digitr Both numhcrs must have the sanre
numher of digits so we write N as t)3250. Tating th!, l0's crrmplement of N pnxlues a
9 in lhe mo6t sitnificr8nt position.The occurrence of tbe end carq, signifies that t{ N j
and that the rBult is therefore p,ositive.
I
EXAMPLE I.6
Using lt)'s complerr^,^nt, subtracr -115() - 7]5-U.

ll : 0325(r
l0's complemeot of 19 : + l7t5tl
Sum = 30?lll
There is no end carrl-Thert'fore. the answer is -( l0's complement of 3t7l lt) = -6g82.
n-otc that sincc .
7?532. the result is negative. Because we are dealing with
-1250
unsisned numbers. thcre is rcally no wav to get arl unsigoed rcsull for this cas{..-When
subtracting with conrplemenls we recognize the negative answer frolll the absence
of lhc end carrv and the complemented resuk. When *orking wirh paper and pencil.
we can change the ans*er to a signed negtative numbcr in order topur it in a famil_
iar form.
Subtraaion rrith complements is done *ith trinary numhers in a similar manncr. using
_
lhe procedure outlioed previouslv
a

EEAC 109 A odute I


16

Signed Binary Numbers


As an exampte, consider the number 9, represented in binary with
eight bits. +9 is represented with a sign bit of 0 in the leftmost position,
foltowed by the binary equivalent of 9, which gives 00001001 . Note that all
eight bits must have a value; therefore, 0's are inserted fotlowing the sign
bit up to the first 1. Atthough there is only one way to represent +9, there
are three different ways to represent -9 with eight bits:

signed-magnituderepresentation: 10001001
signed- 1's-comptement representation: I 1 1 1 01 1 0
signed-2's-complement representation : 1 1 1 1 01 1 1

ln signed-magnitude, -9 is obtained from +9 by changing only the sign


bit in the leftmost position from 0 to 1. ln signed-l 's-comptement, -9 is
obtained by comptementing att the bits of +!, including the sign bit. The
signed-2's-complement representation of -9 is obtained by taking the 2's
comptement of the positive number, including the sign bit.
Tabte 1.3 tists all possible four-bit signed binary numbers in the three
representations. The equivalent decimaI number is atso shown for
reference. Note that the positive numbers in a[[ three representations are
identical and have 0 in the leftmost position. The signed-2's-comptement
system has onty one representation for 0, which is a lways positive. The
other two systems have either a positive 0 or a negative 0, something not
encountered in ordinary arithmetic. Note that atl negative numbers have a 1
in the leftmost bit position; that is the way we distinguish them from the
positive numbers. With four bits, we can represent 16 binary numbers. ln
the signed-magnitude and the 1's-complement representations, there are
eight positive numbers and eight negative numbers, inctuding two zeros. ln
the 2's-complement representation, there are eight positive numbers,
inctuding one zero, and eight negative numbers.

T.blc l.,

Jlgncd,2'r tlgncd-l't tlgncd


De(lmrl Complcmenl Complement M.qnltlldc
7 0ltl 0lll 0lll
6 0l to 0lt0 0lt0
5 0l0l 0l0l 0l0l
.1 010f, 01fi) otff)
rxt I I mll mll
l {x)lfr 00 t0 00t0
I lx,lt I (xnl rxt
t, {)lr{r() rrufl) uxt)
tl llll lfit)
I lllI ltn l{}0t
? llll) r l0! t0t0
L l Il0t I100 l0l I
.l 1lu) ()lt llfl)
5 r0ll llI0 ll0l
l0l0 l00 t t0
lml lffio llll
L 7
li lffx)
17

Lesson 2

lntroduction to Logic Gates

Bootean functions may be practically implemented by using etectronic


gates. The foltowing points are important to understand.

. Etectronic gates require a power suppty.


. Gate INPUTS are driven by vottages having two nominal vatues, e.g.
0V and 5V representing logic 0 and logic 1 respectively.
. The OUTPUT of a gate provides two nominat vatues of voltage onty,
e.g. 0V and 5V representing logic 0 and logic 1 respectivety. ln
generat, there is onty one output to a logic gate except in some
speciat cases.
. There is always a time delay between an input being apptied and the
output responding.

*l
\P Truth Tabtes

Truth tabtes are used to hetp show the function of a togic gate. lf you are
unsure about truth tabtes and need guidence on how go about drawning
them for individual gates or [ogic circuits then use the truth tabte section
tink.

,,'l
V Logic gates

Digital systems are said to be constructed by using logic gates. These gates
are the AND, OR, NOT, NAND, NOR, EXOR and EKNOR gates. The basic
operations are described betow with the aid of truth tables.

AND gate

2lnpfiA D qata
A A.B
A ! 0 0
AB 0 1 tl
B
1 0 0
AND 1 1 1

The AND gate is an etectronic circuit that gives a igh ou tput (1 ) onty
if all its inputs are high. A dot (.) is used to show the AN D operation
i.e. A.B. Bear in mind that this dot is sometimes omitted i.e. AB

OR gate

EEAC 109 A odute I


'18

2 lrpul OR q.rte
A D A+B
tl 0 0
A
B
A-+B ! 1 1

l U 1

OR T 1 1

The OR gate is an electronic circuit that gives a high output (1 ) if one


or more of its inputs are high. A ptus (+) is used to show the OR
operation.

NOT gate

NOT onle
A A
^lA
0lj
NOT 1 lo
The NOT gate i s an etectronic circuit that produces an inverted
version of the input at its output. lt is also known as an inverter. lf
the input variable is A, the inverted output is known as NOT A. This
is atso shown as A', or A with a bar over the top, as shown at the
outputs. The diagrams below show two ways that the NAND togic gate
can be configured to produce a NOT gate. lt can also be done using
NOR togic gates in the same way.
A_ A
A E 1-_*,!-
NAND gate

2 lnpur AND gate


E AE
A r---.
ol
"--_1-j
s u
0
1
0

0
1

1
1

NAND l 1 0
This is a NOT-AND gate whi ch is equal to an AND ga te ollowed by a
NOT gate. The outputs of atl NAND gates are hi gh if any of the inputs
are ow. The symbol is an AND gate with a sma [[ circle on the output.
The smatl circte represents inversion.

NOR gate
2 lnpul IOR qate
A A+B
A rl rl 1

r1
A+R 0 1 tl
1 rl rl
NOtr 1 1 0
This is a NOT-OR gate which is eq uat to an OR gate Iowed by a NOT
gate. Th e outputs of att NOR gates are low if any of the inp uts are
high.

EE AC 109 rvodute i
19

The symbol is an OR gate with a sma[[ circle on the output. The smatl
circle represents inversion.

EXOR gate
2 lnpur EXOR qate
A E AOE
0 0 0
A
B A(:JB 0 1 1

1 rl 1

EOR ,l
l 0
The 'Exclusive-OR gate is a circuit which wit give a high output
if either, but not both, of its two inputs are high. An encircled ptus
sign (@) is used to show the EOR operation.

EXNOR gate

2 hpur EX OR qare
A E A@E
0 0 'l
A
B reE 0
1
,]

0
0
0
EN{:IR 1 1 1

The 'Exclusive-NoR' gate circuit does the opposite to the EOR gate. lt wilt
give a low output if either, but not both, of its two inputs are high. The
symbol is an E(OR gate with a sma[[ circle on the output. The smalt circle
represents inversion.

The NAND and NOR gates are catled universo I functions since with either
one the AND and OR functions and NOT can be generated.

Note:

A function in sum of producfs form can be implemented using NAND gates


by replacing all AND and OR gates by NAND gates.

A function in product of sums form can be imptemented using NOR gates by


reptacing att AND and OR gates by NOR gates.

Table 1: Logic gate symbols

EEAC 109 A,{odu(e I


20

A
R
AB ! ----i-.-'-n.+
AND OR
A
A
D
ru B ---l )>, TE
NNND NOR

A
R
---lt 1I......--
AOB
A A troR

NOT A
lt$B
B
-l ENOR

Tabte 2 is a summary truth table of the input/output combinations for the


NOT gate together with atl possibte input/output combinations for the other
gate functions. Also note that a truth tabte with'n'inputs has 2n rows. you
can compare the outputs of different gates.

Table 2: Logic gates representation using the Truth table

INPUTS OUTFUTS
A B AND NAND OR NOR EXOR EXNOR
l{ OT q are 0 0 0 1 0 1 0 1

A 0 1 0 1 1 0
,l
0
,l
0 I ,1
0 0 1 0
,l
0
1 0 1 1 1 0 'l 0 0 1

=L
Example
-l
A NAND gate can be used as a NOT gate using either of the fottowing wiring
configurations.
P,
-d lr-r 1

EEAC 109 l,lodute I


21

Lesson 3

Boolean Algebra Theorems

"0" and "1" being used to represent a digitat


As wetl as the togic qymbots
input or output, we can atso use them as constants for a permanentty
"Open" or "Closed" circuit or contact respectivety.
A set of rutes or Laws of Boolean Atgebra expressions have been invented to
help reduce the number of togic gates needed to perform a particular logic
operation resutting in a tist of functions or theorems known commonty as
the Laws of Boolean Algebra.
Boolean Algebra is the mathematics we use to analyse digitat gates and
circuits. We can use these "Laws of Bootean" to both reduce and simptify a
comptex Bootean expression in an attempt to reduce the number of logic
gates required. Boolean Algebra is therefore a system of mathematics based
on logic that has its own set of rutes or laws which are used to define and
reduce Bootean expressions.
The variabtes used in Boolean Atgebra onty have one of two possibte vatues,
a togic "0" and a logic "1" but an expression can have an infinite number of
variabtes att tabetted individuatty to represent inputs to the expression, For
exampte, variables A, B, C etc, giving us a logical expression of A + B = C,
but each variabte can ONLY be a 0 or a 1.
Examptes of these individual laws of Boolean, rutes and theorems for
Bootean Atgebra are given in the fottowing tabte.

Truth Tables for the Laws of Boolean

A+1=1 A in parattet with ,-r-, (j-r


Annutment
ctosed = "CLOSED" {,q-.._J*

A+0=A A in parattel with r-.o o-r


Op€O = "A" {-4-*} ldentity

EEAC 109 Alodute


22

A.1=A A in series with


ldentity
closed = "A"

A.0=0 A in series A
with __?.__o
o- Annutment
open = "OPEN"

Ain paratlel
A+A=A with
L^-J
-A-t- ldempotent

A.A=A A In series with


ldempotent
A

NOTA=A NOT NOT A


Doub[e Negation
(doubte negative) = "A"

A+A=1 A in parattel with


Comptement
NOT A = "CLOSED"

A.A=0 A in
NOT A = "OPEN"
series with *-L Complement

A in J/*
A+B = B+A
paratte[ with
B in paraltel with A
B=
fu-J Commutative

EEAC 109 Alodute I


23

A.B = B.A
A in
B
series
in series with A
with B= _L3* Commutative

A+B = A.B
invert and reptace OR de r\rlorgan's
with AND Theorem

A.B = A+B
invert and reptace AND de Morgan's
with OR Theorem

The basic Laws of


Boolean Algebra that retate to the Commutative
Low atlowing a
change in
position for addition and muttiplication,
the Associotive Low attowing the removal of brackets for addition and
muttiplication, as we[[ as the Distributive Low attowing the factoring of an
expression, are the same as in ordinary algebra.
Each of the Booleon Lows above are given with just a singte or two
variables, but the number of variabtes defined by a singte taw is not limited
to this as there can be an infinite number of variabtes as inputs too the
expression. These Bootean laws detaild above can be used to prove any
given Bootean expression as wetl as for simptifying compticated digitjt
ci rcuits.

A brief description of the various Laws of Boolean are given below


with A representing a variable input.

Description of the Lows of Balean Algebro

.Annulment Law - A term AND'ed with a ,.0,, equats 0 or OR'ed with a .,1,,
witt equat 1

A.0=0 A variable AND'ed with 0 is always equat to O


A+'l =1 A variabte OR'ed with 1 is atways equal to 1

.ldentitv Law - A term OR'ed with a .,0,' or AND'ed with a .,1', witt atways
equal that term

o A+0=A A variable OR'ed with 0 is always equat to the


variable

EEAC 109 Alodute I


24

o A.1=A A variable AND'ed with 1 is atways equal to the


variable

.ldempotent Law - An input that is AND'ed or OR'ed with itself is equat to


that input

A+A= A A variable OR'ed with itsetf is always equal to the


variable
A . A = A A variabte AND'ed with itself is always equal to the
variabte

.Comptement Law - A term AND'ed with its comptement equats "0" and a
term OR'ed with its comptement equats "1"

A . A = 0 A variabte AND'ed with its comptement is atways equat


to0
A+A= 1 A variabte OR'ed with its comptement is atways equal
to1

. Commutative Law - The order of apptication of two separate terms is not


important

A .B= B AThe order in which two variables are AND,ed


makes no difference
A+B=B+ A
The order in which two variabtes are OR,ed makes
no difference

L . Double Neqation Law - A term that is inverted twice is equat to the


i original term
L
A = A A doubte comptement of a variabte is atways equal to
L the variab[

I
. de Morgan's Theorem - There are two "de Morgan's,, rutes or theorems,
L
.(1) Two separate termsNoR'ed together is the same as the two terms
inverted (Comptement) and AND'ed for exampte: A+B = A . B
!
I

.(2) Two separate terms NAND'ed together is the same as the two terms
inverted (Comptement) and OR'ed for exampte: A.B = A + B
l-

b EEAC 1 lvlodute I

,-
25

Other atgebraic Laws of Bootean not detailed above inctude:

. Distributive Law - This law permits the muttiptying or factoring out of an


expression.

A(B + C) = A.B + A.C (OR Distributive Law)


A + (B.C) = (A + B).(A + C)
(AND Distributive Law)

.Absorptive Law - This law enabtes a reduction in a compticated expression


to a simpler one by absorbing tike terms.

A+(A.B)=[ (OR Absorption Law)


A(A+B)=A (AND Absorption Law)

. Associative Law - This law altows the removal of brackets from an


expression and regrouping of the variabtes.

A+ (B *C) = (A+ B) + C=A+ B+ C (ORAssociateLaw)


A(B.C)= (A.B)C=A. B. C (ANDAssociareLaw)

.6 LEARNING ACTIVIry

Present the truth tabte for 3-input and AND and 3-input OR
gates.

H a
MODULE SUAAAAARY

The general procedure to perform mathematica[ operations is to


convert the number from the given base to decimal and then do the
operation and convert back to the given base.
a Negative numbers are usuatly expressed in comptement form. There
are two types of comptements: Radix Minus one and True
comptement.

EEAC l09lrtodute I
26

. ln Bootean atgebra, a variabte has only two possibte vatues either 1 or


0.
o The output of a togic OR is togic one when one of the inputs is togic
one.
. The output of a togic AND is one when at[ inputs are togic one.
. The output of a NOT gate or inverter in the comptement of the input.

Congratutations! You have just studied lvlodute l. now you are ready
to evatuate how much you have benefited from your reading by ansrering
the summative test. Good Luck!!!

,6 SUMMATIVE TEST

1. What is the targest binary number that can be expressed with 14 bits?
What are the equivalent decimat and hexadecimal numbers?
2. Convert decimat number 431 in two ways: (a) Convert directty to
binary; (b) convert first to hexadecimal and then from hexadecimal
to binary. Which method is faster?
3. Obtain the 1's and 2's comptements of the fottowing binary numbers:
a. 10000000
b. 00000000
c. 11011010
d.01110110
L e. 10000101
f. 11111111
4. Find the 9's and the 10's comptement of the fottowing decimal
number:
a. 52,7U,630
b. 63,325,600
c. 25,000,000
d. 00,000,000
5. (a) Find the 16's comptement of B2FA.
L (b) Convert BZFA to binary.
(c) Find the 2's comptement of the result in b.
(d) Convert the answer in (c) to hexadecimat and compare with the
L answer in (a).
6. Perform subtraction on the given unsigned numbers using 10's
comptement of the subtrahend. When the result shoutd be negative,
find its 10's comptement and affix a minus sign. Verify your answers.
a. 6,428 - 3,409
b. 125 - 1,900
c. 2,043 - 6,152
d. 1,631 - 745
7. Decode the fottowing in ASCII code:

L EEAC 109l'lodute I
uIIllF

27

1010011 1110100 1100101 1110110 1100101 0100000 1001010 1101111


1100010 1110011.

8. By means of a timing diagram simitar to Fig. 1.5 , show the signats of


the outputs f and g in Fig. P1.35 as functions of the three inputs a, b,
and c. Use att eight possible combinations of a, b, and c.

abc

o
5

fiGURE pi.35

EEAC 109

You might also like