You are on page 1of 93

##################>###

#################s###########u###########r###

#7
########################bjbjU#U################### ###-R##7|##7|
##<#######a#############################################################l####
######################################################l#######:#######:#####
##:###8###r#############l#######,##2###6#######:###L########################a
#######a#######a#######H,######J,######J,######J,######J,######J,######J,##$###-##
####0##p###n,#############################a#######################a#######a#######
a#######a#######n,######[##########################################,######[##
#####[#######[#######a###X###############################H,##############[#####
##################################################a#######H,######[#######[#######[
###r###T&##T#####################################################################
####T'#############*###

###':#l######:#############&##############T'#####,##0###,######&#####
0######k######0######T'######[##########J###6###6###########################
#########IST 2710: Worksheet: Logic Gates[This materials overlaps with the
Critical Thinking General Education requirement.] The worksheet on Binary Arithmetic
With Switches showed that simple mechanical switches can carry out arithmetic.
While switches are easy to understand, and were actually used in some early
computers, they are, however, slow. Even though switches are no longer used,
computers are still built with these and similar functions. There have been many
technologies used in computers to replace switches, including vacuum tubes,
transistors and different generations of microchips. However, the basic functions
have remained constant. Because the technology and construction details change
while the function remains constant, it is very useful to have representation or
symbols for the functions, independent of the technology used to implement the
function. This set of representations or symbols is called logic gates. The logic
part because they represent classical logical relationships, and gates because they
can steer signals to different parts of a large circuit. Here are some examples of
logical relationships:"If you wash the dishes and clean your room, you can go to
the party." Your kid has washed the dishes but not cleaned the room. Does your kid
get to go to the party under this rule? (AND) "I will let you go to the party if you
wash the dishes or clean your room." Your kid has cleaned their room but the dishes
are still dirty. Does your kid get to go to the party under this rule? (OR) Same
rule as #2, but your kid both washed the dishes and cleaned up their room - do they
get to go? (Inclusive or, OR, includes cases where both conditions are true) "I
either aced that test (90 or above) or I bombed it (less than 70) ." What are the
chances of getting a grade that is 90 or above and below 70 at the same time?
(Exclusive or, XOR, excludes case where both conditions are true) Login Gates are
drawing that represent these logical relationships (AND, OR, XOR) with shapes.
Logic gates are drawn with a shape representing the function of the gate (AND, OR,
XOR) two input lines on the left-hand side (sometimes more, but not here) , and
letters to identify the inputsone output line on the right-hand side, and a letter
to identify the outputThe logical function is made explicit with a truth table. In
the truth table, 0 represents false and 1 represents true.Here are the most
important examples. The name of the gate is its logical function that relates the
inputs to the outputs. Take an AND gate, for example. Its output is true (1) if
input A is true AND (2) input A is true. If you have taken Critical Thinking, you
should recognize the logical functions. The difference is that here, we are
considering them as actual hardware. The logical functions used here are: The
output of an AND gate is true if (1) input A is true AND (2) input B is true,
otherwise the output is false.The output of an OR gate is true if (1) input A is
true OR (2) input B is true; otherwise the output is false (inclusive or, result is
true if both A and B are true) .The output of an XOR gate is true if (1) input A is
true XOR (2) input B is true, otherwise the output is false (exclusive or) .Notice
that all of these can be summarized as follows (one thing to memorize instead of
three) :The output of an XXX gate is true if (1) input A is true XXX (2) input B is
true, otherwise the output is false.The statement above works if you put AND in for
both XXXs, or OR, or XOR, but you must put the same thing in both XXXs. Also, the
function goes with the shape of the drawing; you need to memorize this association.
Always start at the left with the inputs, and end at the right with the outputs.1.
AND gate. So named because the output is true if Input A is true and Input B is
true. In the switch worksheet, this was the series connection. As with switches,
work row by row. (This function carries out binary multiplication.)
A#B#C##0#0###0#1###1#0###1#1####2. OR gate. This is the normal inclusive or;
the output is true if A is true, or if B is true, or if both are true. Inclusive
means that the case where both inputs are true is included in making the output
true.A#B#C##0#0###0#1###1#0###1#1####3. Exclusive or, or XOR (pronounced
"zor") ; the output is true if A is true, or if B is true, but not if both are true.
(This function carries out binary addition, except for the carry in the case of 1 +
1.) A#B#C##0#0###0#1###1#0###1#1####More complicated circuits: combinations.
The circuit below has two logic gates, an XOR and an AND. In this type of drawing,

a line transmits a value from one end to the other end without change; either both
ends are true or both ends are false. The lines on the drawing shows that the input
at A is delivered without change to the top input of the XOR and the top input of
the AND. Also the B input is delivered without change to the bottom input of the
XOR and the top input of the XOR. Work from left to right, same as before.4.
Combining the XOR and AND gates carries out binary addition with the carry. Which
bit (C or D) is the carry? Which one is the addition?
A#B#C#D##0#0####0#1####1#0####1#1#####NOTE: If you are uncertain or having
trouble, try writing in the 1s and 0s on the diagram, right at the inputs and
outputs. Do this in pencil so you can change the values for the next row.To
illustrate the steering capabilities of gates, we need one more feature, inversion.
Any signal line (an input or output) can be inverted by placing a circle on its
connection to the body of the logic gate. The circle inverts the truth of that
input. This means that it changes true to false or false to true, before it gets
used by the gate itself. NOTE: If you are drawing in the 1s and 0s, draw them here
both before and after the inversions.5. Using the two inversions in the circuit
below, complete the truth table.A#B#C##0#0###0#1###1#0###1#1####Now, with the
inversion function, we can see how gates can steer.6. Fill in the truth table for
this circuit. After you have finished, notice that bit A steers bit B from C to D.
In this way, data can be steered from a multiplier to an adder; we can select which
binary operation (multiplication or addition) to perform. Also, data can be steered
to or from a particular memory location.
A#B#C#D##0#0####0#1####1#0####1#1#####A more complicated problem. Work from
left to right. Do not try to find the output of a gate before you have found both
of its inputs, since the inputs cause the outputs.7. Fill in the truth table for
the circuit above. HINT: Make a bigger truth table off the side, to show the values
in between the gates.A#B#C##0#0###0#1###1#0###1#1####NOTE: On Quiz and the
Final, the full truth table takes too long to fill out. More likely is a question
giving a value for A and a value for B, as in A = 0 and B = 1. This amounts to
doing a single row of the truth table.
Logic Gates Worksheet
Page # PAGE #5# of
# NUMPAGES #5#
Page # PAGE #1# of # NUMPAGES #5#
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###############################################
#####################################################u###{###|
##############################r###x###y###########################
###i###j###k###l###m###n###o###p###v###w###}###~###########################;###-###.###/###0###1###2###3###4###5###6###>###?
###G###H###P###Q###Y###Z#############################
##################
#j

##U## #j###U##
#j####U###CJ##aJ####5#\###0J####6#] ###>*##5#B*#CJ$#\#aJ$#ph####R####!
###u###n###*
##
##
##{######3

##

##

##`
#####n#############f###<######u###w########################################
#############################################################################
#############################################################################
#############################################################################
###$##$#If####a$#

##
&##F###d##d#[$#\$#

##
&##F###d##d#[$#\$#

##
&##F###d##d#[$#\$#

##
&##F###d##d#[$#\
$##########$#a$#######<#########################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
################################w###y###{###|
###~################################################j####################
################d############j####################################d############j
#########################$#If########$##$#If#####i############################F
###C#
#s##################q###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

############
###$##$#If####a$#####################################################
######################d################################################d#######
#####b############b############b#########################$##$#If#####i##########
##################F###C#
#s##################q###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

################$#If####
###$##$#If####a$######r###t###v###x###y###{###}#############################
##################################h####################################b#######
#####h#############################################$#If########$##$#If#####i##
##########################F###C#
#r##################r###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

############
###$##$#If####a$######################################################
#m############d############d########################m############d############d###
#####################m############b#####################
###$##$#If####a$#####$##$#If#####i############################F###C#
#r##################r###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

################$#If###############i###k###m###o###p###r###t###v###w###########
################################################################h############
########################b############h#####################$#If########$##$#If###
##i############################F###C#
#s##################q###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

############
###$##$#If####a$#######w###y###{###}###~###################################
#########################d################################################d###
##########################################################$##$#If#####i######
######################F###C#
#s##################q###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

################$#If####
###$##$#If####a$########################/###1###3###5###s############q############q############q############q###########
#q############h############h############h############h#############################
#################
###$##$#If####a$#########$##$#If#####i############################F###C#
#s##################q###################################6
#0################################################2
#6##

#############

#############

#############

############3#######4#####i#a###b

#############
5###6###8###:###<###>###?
###A###C###E###^$###########U############U############O############O############^$#
##########U############U############O#################$#If####
###$##$#If####a$#####$##$#If#####i############################\###T#
########################################################################6
#0################################################
#6#########################################################################3##
#####4#####i#a###b##################
E###G###H###J###L###N###P###Q###S###U###############X$###########O############O###
#################################X$###########O############O#############
###$##$#If####a$#####$##$#If#####i############################\###T#
########################################################################6
#0################################################
#6#########################################################################3##
#####4#####i#a###b#####################$#If#####
U###W###Y###Z###\#######z######&###########################X############V#######
#####V############V############V############V######################################
##############$##$#If#####i############################\###T#
########################################################################6
#0################################################
#6#########################################################################3##
#####4#####i#a###b#####################$#If######Z###[###e###n###&###'###(###) ##
#*###+###,######3###4###:###;###A###B###H###I###J####################################
##########################6###7###8###9###:###;###<###=###C###D###J###K###Q##
#R###X###Y###Z###Z###[###a###b###c###d###h###i###s###t###u###v###~#############
#################################################
##########################mH##nH##u## #j####U##
#j1##U##
#jU'##U##
#j ##U###CJ##aJ####5#\###6#] ## #jq###U###Q&###(###*###,######/###1###3###4###6###8###:#######################################j############
########################d############j####################################d####
#####################$#If########$##$#If#####i############################F##
#h# #f##################f##################f#################6
#0################################################P
#6##

#############

#############

#############

############3#######4#####i#a###b

############
###$##$#If####a$###:###;###=###?
###A###B###D###F###H###I###K###L###s############j############j############d########
####s############j############j############d############s############b############b
#########################$#If####
###$##$#If####a$#####$##$#If#####i############################F###h#
#f##################f##################f#################6
#0################################################P
#6##

#############

#############

#############

############3#######4#####i#a###b

##############L###N#####################################################
##########################################################S$##################
##################$##$#If#####i############################\###'#v

#P##################O##################O##################_#################6
#0################################################M
#6#########################################################################3##
#####4#####i#a###b#################
###$##$#If####a$######
##################################################################O$##
#########################################################O$################$##
$#If#####i############################\###'#v

#P##################O##################O##################_#################6
#0################################################M
#6#########################################################################3##
#####4#####i#a###b#####################$#If####
###$##$#If####a$##
#####################################################################
#########O$################################################################$##
$#If#####i############################\###'#v

#P##################O##################O##################_#################6
#0################################################M
#6#########################################################################3##
#####4#####i#a###b#####################$#If####
###$##$#If####a$##
##############6###8###:###<###^############\############\############\###########
#S############S############S#######################################################
###$##$#If####a$#########$##$#If#####i############################\###'#v

#P##################O##################O##################_#################6
#0################################################M
#6#########################################################################3##
#####4#####i#a###b###################<###=###?
###A###C###D###F###H###J###K###M###O###s############j############j############d####
########s############j############j############d############s############j#########
###j#########################$#If####
###$##$#If####a$#####$##$#If#####i############################F###h#
#f##################f##################f#################6
#0################################################P
#6##

#############

#############

#############

############3#######4#####i#a###b

##############O###Q###R###T###V###X###Y###[###\###^###<###S###############m#######
#####d############d########################m############b############b############
b############b############`#####################
###$##$#If####a$#####$##$#If#####i############################F###h#
#f##################f##################f#################6
#0################################################P
#6##

#############

#############

#############

############3#######4#####i#a###b

################$#If######S###T###w###x######################################
##############################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
########################################+#
0#&P##1h#/R ##/ =!##"####$#
%#################################################################################
###################################################################################
###################################################################################
###################################################################################
###################################################################################
###########################################################D#d####################
#
#######################################T####
#### ####
##C##0####A####################G#a#t#e#A#N#D#.#g#i#f#############b##W#####^
#TOM+5'3########D#######n#+###^#TOM+5'PNG
#
###IHDR######W#####Q####bKGD###2###

cmPPJCmp0712###`###IDAThCZ/tL##N-.uT9\pA#9s

##"A#H:.#BL{{}}}fgvv'-|k##S7Fo@n{T#X(#] ?#
#yZ`u#(q##AuXF-#]

5N#Z:1C#"] |W6 G,5#[*q~P#<F#L_N,#,


+FgAY;'d#a#FOmN>#%QK#y3#?c>^%~ $#h##\#2#
m#g2@#-) nAd4
+:R#=*#B#T#L###^T##m:AYYcBVX(#o#OP D8(3#{ND
2MB*#h#z*u###<%o
N}Yq-|g#-6
J:4

2-s
Hr#Os#
m#5#XPEe##zid`
) #(3H?Py4m~WJq8S@+#####U iH#
:[eY#L#2V~@ ?AJ#&#&#|
#$2##7###wXqxAZze(5#O,2pb#yv
#*#>X_[IPrIKF) Th#g

[#LM#r####o0iFTn0kx@#\5*##t#<9#R##6 >#,##*2#,-!I*c#w!

p( #^ [#=##|
fZ#+#HUd5$zj#dxk###=3r##'~,k#N####.
##%`Z |."t`#{Wt&#d] txJ+EBWBN'*EDbF,1=m###%$
}#Y:0####:r~q/#@j

0#vxa1v] yzf2##UKb#J62# `Zal?#Je#he#53h@!


*##~M ###yAX

he#3##1i#P#_7F9I#.e########IENDB`###D#d###############
######
d######################################R####
####

####
##C##.####A
###################G#a#t#e#O#R#.#g#i#f#############b##,#####UmXQ[3\
dD#########C#######n#####UmXQ[3\dDPNG
#
###IHDR######\######A####bKGD###2###

cmPPJCmp0712###`###IDAThCZ-xL#R:NFr.8##Hk##Gd#8n#I n
n#C#,jnL ,#(#fOw~Q#U`@N|'*@#A#FE9Ts'
%T./F##,jb) YAlB-^n?#_
X(BI###xCH#3#U}U{8#iT{0#EM#l
$#xl
l
,ku1## V`eR

bk_^}|#>####TY#s 3r#!F#6{L#
4`z#R#e(zq&Qn7##
@#C{#*
0#7##Z#(2#eE^p90r#'#I@u3nU#|
#pOLA.2;lw##7n5 K.Je] #9] v(N*58Z`] # ve##hKGx#
] }.8<}#~sV#q##SSpden:#h6I#
O$B#'LJd####BIEZ##+##i7#L3#i(#RA#6R ###8y#~f#r#e#
7#
#
#1h##A,(
V#a#?#amJa##dS#
dI 0tZ
.a#s###y2M;bQ_##x##rC r-f\] 26BwJS#U4CP$#J
l#I7_hUae5##UB5#Ls#1H#(+f##Lns1
PI5TW#d#QZ`f\#] ] #GF\
9Ks;#M,#CdC+yB_$.@>D,}~}V?
G.O#{F###SY##ab#J#av(03|g7:;pp$_<#>#.#8+;Y b##8&##g+

%P.^#6ZHwIumnGF};Zmt_#:A>Ju&"~"`

r=e#gtW&#J<H##%"2~hs#@#k Id#j#RA#6 C#%78


m#M:$|J,;[
7*

I#V&f|>#ca#r?n|B#T#*#[#c#kof%L1aj###!2Oa#
n

#] #$LI`

f5#nCdu`R #0L^c#>%##1yc(#s

E1#3kFZ####IENDB`###D#d#####################
7######################################T####
#########
##C##0####A
###################G#a#t#e#X#O#R#.#G#I#F#############b#######9=,M|
##zt###############n####9=,M|##ztPNG
#
###IHDR######Y#####0####bKGD###2###

cmPPJCmp0712###`###\IDAThCZtH#] 5u2RG#<G#HK#HL#u#:p@R#\xI#$Ms|
;wfpQ#4#ND#'EVl#-[d>#Gewj'##Ab#\v##Q#:
Y6o[A#XWMm#Q&nFr4B#mC1C###Y#+KC#iTVZLw3#}#bB<Z<<
]
##+#I #~ 6p97##5##*:#df5W7#?+m#E#_#W
[b.1W#'mV
#~o#t"U{ Y|

0#wDjk>Z_DN##

c[] wH@#ED;
IB
\Ra#I,#jdz#Z+
^@4X
#n##[#L.x#7>xQ) p##p&#b#5#-$
(&Dw^*z_#{Hf#(&4#[O= U.t+g
#I#0#~fokOV#j;#(#tv#M#Xy9CY##DE##}R,#b#&C`:d#
~##Y#:#G#V#dADuPA#?
#
B##jW) #Dk*W*[#@#Y#y^2Md#Q#1j#u"#G###<H

#dOX##4u#) #[`(YZ#!F+4%s#KL>Bi 2eM&M#j#;c#

)
\X=P*:|3CxIO#4c;#e#Gyc#,#) )
bg)
#}Q:##8[j#I,#dG#TXj$#l#".&#Fy j#WA&#Kn(i##k

QOIpY
.lp

q>5L% ') fJ##N,~jR#+


{SS#~#o/Qp`m##6$#&#Q #!xv#] G#Z~4#5``
#WV,D#z

g#\'V3%v(S#*>_'Qh77
e *#=#F46$#rU%PmE#

%anLx#cuo;LxJR
s F~#Ov$3TI|t~_UkvoC#UR
AByZ#=TfTX9] 1u*#'a%##K#~#gwsBbcYx}T(fc#
%#>e#bLD) N
1N;F#F?#] ^j'fCK[##AL0jB #3
6C5EXkpT+) j#VdS#uG#>((I@#O6B#1--b-'G
%gTkV#(,o"#jnp r] #LV%TQzea%wy M##%#/7#"Q
Q<3#E#jDm#;j yfW

#f :#-UN#vRh
c|##C(#h####IENDB`V

##D#d#####################^#######################################T####
#########
##C##0####A####################G#a#t#e#A#D#D#.#G#I#F#############b########
v=jyy#################n#####v=jyy##PNG
#
###IHDR###########X####bKGD###2###

cmPPJCmp0712###`####IDATx^\/x:#?{e>9@Q9#s,@2#u#G#u4i7
{$/$'WG##.###/,\X##E
6# DC) J|
r,8bosWQkT'BpW|] #`0;=,mCe/L_^) S9^xn>|
PS\H6#f##TLd?
0#}/JK@`#,h##
#
Y i#H ,R(1.DMV^5TG#~Yh~####D"{N##R1#W`Kq>##

You might also like