You are on page 1of 6

IST 2710: Worksheet: Logic Gates

[This materials overlaps with the Critical Thinking General Education requirement.] The worksheet on Binary Arithmetic ith !witches showed that simple mechanical switches can carry out arithmetic. hile 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 #uilt with these and similar $unctions. There have #een many technologies used in computers to replace switches" including vacuum tu#es" transistors and di$$erent generations o$ microchips. %owever" the #asic $unctions have remained constant. Because the technology and construction details change while the $unction remains constant" it is very use$ul to have representation or sym#ols $or the $unctions" independent o$ the technology used to implement the $unction. This set o$ representations or sym#ols is called logic gates. The logic part #ecause they represent classical logical relationships" and gates #ecause they can steer signals to di$$erent parts o$ a large circuit. %ere are some e&amples o$ logical relationships' (. )*$ you wash the dishes and clean your room" you can go to the party.) +our kid has washed the dishes #ut not cleaned the room. ,oes your kid get to go to the party under this rule- .A/,0 1. )* will let you go to the party i$ you wash the dishes or clean your room.) +our kid has cleaned their room #ut the dishes are still dirty. ,oes your kid get to go to the party under this rule- .230 4. !ame rule as 51" #ut your kid #oth washed the dishes and cleaned up their room 6 do they get to go- .*nclusive or" 23" includes cases where #oth conditions are true0 7. )* either aced that test .89 or a#ove0 or * #om#ed it .less than :90.) hat are the chances o$ getting a grade that is 89 or a#ove and #elow :9 at the same time.E&clusive or" ;23" e&cludes case where #oth conditions are true0 <ogin Gates are drawing that represent these logical relationships .A/," 23" ;230 with shapes. <ogic gates are drawn with

a shape representing the $unction o$ the gate .A/," 23" ;230 two input lines on the le$t6hand side .sometimes more" #ut not here0" and letters to identi$y the inputs one output line on the right6hand side" and a letter to identi$y the output

The logical $unction is made e&plicit with a truth ta#le. *n the truth ta#le" 9 represents $alse and ( represents true. %ere are the most important e&amples. The name o$ the gate is its logical function that relates the inputs to the outputs. Take an A/, gate" $or e&ample. *ts output is true .(0 i$ input A is true A/, .10 input A is true. *$ you have taken Critical Thinking" you should

=age ( o$ >

<ogic Gates

orksheet

recogni?e the logical $unctions. The di$$erence is that here" we are considering them as actual hardware. The logical $unctions used here are'

The output o$ an A/, gate is true i$ .(0 input A is true A/, .10 input B is true" otherwise the output is $alse. The output o$ an 23 gate is true i$ .(0 input A is true 23 .10 input B is true@ otherwise the output is $alse .inclusive or" result is true i$ #oth A and B are true0. The output o$ an ;23 gate is true i$ .(0 input A is true ;23 .10 input B is true" otherwise the output is $alse .exclusive or0.

/otice that all o$ these can #e summari?ed as $ollows .one thing to memori?e instead o$ three0'

The output o$ an ;;; gate is true i$ .(0 input A is true ;;; .10 input B is true" otherwise the output is $alse.

The statement a#ove works i$ you put A/, in $or both ;;;s" or 23" or ;23" #ut you must put the same thing in #oth ;;;s. Also" the $unction goes with the shape o$ the drawing@ you need to memori?e this association. Always start at the le$t with the inputs" and end at the right with the outputs. (. A/, gate. !o named #ecause the output is true i$ *nput A is true and *nput B is true. *n the switch worksheet" this was the series connection. As with switches" work row #y row. .This $unction carries out #inary multiplication.0

A 9 9 ( (

B 9 ( 9 (

=age 1 o$ >

<ogic Gates

orksheet

1. 23 gate. This is the normal inclusive or@ the output is true i$ A is true" or i$ B is true" or i$ #oth are true. *nclusive means that the case where #oth inputs are true is included in making the output true.

A 9 9 ( (

B 9 ( 9 (

4. E&clusive or" or ;23 .pronounced )?or)0@ the output is true i$ A is true" or i$ B is true" #ut not i$ #oth are true. .This $unction carries out #inary addition" e&cept $or the carry in the case o$ ( A (.0

A 9 9 ( (

B 9 ( 9 (

=age 4 o$ >

<ogic Gates

orksheet

Bore complicated circuits' com#inations. The circuit #elow has two logic gates" an ;23 and an A/,. *n this type o$ drawing" a line transmits a value $rom one end to the other end without change@ either #oth ends are true or #oth ends are $alse. The lines on the drawing shows that the input at A is delivered without change to the top input o$ the ;23 and the top input o$ the A/,. Also the B input is delivered without change to the #ottom input o$ the ;23 and the top input o$ the ;23. ork $rom le$t to right" same as #e$ore. 7. Com#ining the ;23 and A/, gates carries out #inary addition with the carry. #it .C or ,0 is the carry- hich one is the additionhich

A 9 9 ( (

B 9 ( 9 (

/2TE' *$ you are uncertain or having trou#le" try writing in the (s and 9s on the diagram" right at the inputs and outputs. ,o this in pencil so you can change the values $or the ne&t row. To illustrate the steering capa#ilities o$ gates" we need one more $eature" inversion. Any signal line .an input or output0 can #e inverted #y placing a circle on its connection to the #ody o$ the logic gate. The circle inverts the truth o$ that input. This means that it changes true to $alse or $alse to true" #e$ore it gets used #y the gate itsel$. /2TE' *$ you are drawing in the (s and 9s" draw them here #oth #e$ore and a$ter the inversions. C. Dsing the two inversions in the circuit #elow" complete the truth ta#le.

=age 7 o$ >

<ogic Gates

orksheet

A 9 9 ( (

B 9 ( 9 (

/ow" with the inversion $unction" we can see how gates can steer. >. Eill in the truth ta#le $or this circuit. A$ter you have $inished" notice that #it A steers #it B $rom C to ,. *n this way" data can #e steered $rom a multiplier to an adder@ we can select which #inary operation .multiplication or addition0 to per$orm. Also" data can #e steered to or $rom a particular memory location.

A 9 9 ( (

B 9 ( 9 (

A more complicated pro#lem. ork $rom le$t to right. ,o not try to $ind the output o$ a gate #e$ore you have $ound #oth o$ its inputs" since the inputs cause the outputs.

=age C o$ >

<ogic Gates

orksheet

:. Eill in the truth ta#le $or the circuit a#ove. %*/T' Bake a #igger truth ta#le o$$ the side" to show the values in #etween the gates.

A 9 9 ( (

B 9 ( 9 (

/2TE' 2n Fui? and the Einal" the $ull truth ta#le takes too long to $ill out. Bore likely is a question giving a value $or A and a value $or B" as in A G 9 and B G (. This amounts to doing a single row o$ the truth ta#le.

=age > o$ >

You might also like