Sie sind auf Seite 1von 24

[DIGITAL-ELECTRONICS IN BIOMEDICAL ENGINEERING, CH-3: LOGICGATES ]

[TEXT-BOOK: INTRODUCTORY-DIGITAL-ELECTRONICS BY NIGEL P.COOK ]


6/4/2013

Bio-Medical-Engineering Guide .Inc


MOHAMMAD-SIKANDAR-KHAN-LODHI

NOTE: ITS MY PERSONAL UNIVERSITY PREPARATIONS NOTES FOR UNDERGRADUATE BIOMEDICAL ENGINEERING PROGRAM WHAT I LEARNED IN BETWEEN 2006-TO-2007 IN SIR-SYED UNIVERSITY OF ENGINEERING AND TECHNOLOGY [SSUET], PAKISTAN KARACHI.
MY BLOG: www.medical-image-processing.blogspot.ca SIR-SYED UNIVERSITY OF ENGINEERING AND TECHNOLOGY [SSUET]: www.ssuet.edu.pk

NOTE: WELL I AM BUILDING MY PERSONAL NOTES FOR BIO-MEDICAL ENGINEERING COURSES PREPARATIONS ON PDF FILES SINCE 2008 AND PUBLISHED IT ON MY BLOG , AND I ALSO DISPLAY MY NOTES IN MY BLOG, BUT THIS CHAPTER I WILL NOT DISPLAY OR PUBLISHED TO PUBLIC ON MY BLOG AND SCRIBD ACCOUNTS BECAUSE THIS DOCUMENT [ OR MY PERSONAL NOES ] CONTAIN THE FIGURES [OR COPY-RIGHT MATERIAL] OF THIS CHAPTER FROM DIRECTLY THE TEXT-BOOK DUE TO COPY-RIGHT LAWS , , I ALWAYS TRY TO BUILD MY NOTES ON PDF DOCUMENTS IN SUCH A WAYS IN WHICH I TRY TO NOT USED ANY COPY-RIGHT MATERIALS ON MY PERSONAL NOTES IN PDF , BUT DUE TO LACK OF TIMING AND IN ORDER TO QUICKLY COMPLETE MY PREPARATIONS OVER BIO-MEDICAL ENGINEERING COURSE I TAKE THIS STEPS IN WHICH I AM JUST TRY TO SAVING MY TIME IN AVOIDING TO DRAW THE PICTURES BY MY HANDS ON A PAPER OR ON THE PRINT WHICH CONSUME A LOT OF TIME , SO I TRY TO GO FAST AND AT LEAST TOOK FIGURES FROM BOOK DIRECTLY AND PLACED ON MY THIS NOTES, AND THIS DOCUMENT IS NOT FOR SALE , ITS ONLY FOR HELPING ME TO GET HIGHER MARKS IN THIS COURSE.

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Table of Contents
LOGIC-GATES:................................................................................................................................................ 3 INTRODUCTION: ............................................................................................................................................ 3 (3-1) HARDWARE FOR BINARY SYSTEMS: .................................................................................................... 4 (3-1-1 ) USING THE DIODE TO CONSTRUCT A LOGIC GATE: ..................................................................... 5 Fig 3-2 the Diode being used in a Digital Electronic Circuit. ................................................................. 6 3-1-2 USING THE TRANSISTOR TO CONSTRUCT A LOGIC GATE: .............................................................. 6 3-2 BASIC LOGIC GATES:- ......................................................................................................................... 7 Fig # 3-4 : The OR-Gate : ...................................................................................................................... 8 Fig # 3-8 The AND Gate : ..................................................................................................................... 10 3-3 INVERTING LOGIC GATES [ NOT, NAND , NOR GATES ]: ...................................................................... 12 3-3-1 THE NOT GATE : ............................................................................................................................. 12 3-3-2 THE NOR GATE: ............................................................................................................................. 14 Fig 3-15 THE NOR Gate : .................................................................................................................... 14 FIG # 3-17 A DATA-SELECTOR/MULTIPLEXER/FREQUENCY SELECTOR CIRCUIT: ................................ 16 3-3-3 : THE NAND GATE: ......................................................................................................................... 16 FIG # 3-18 the NAND Gate: ................................................................................................................ 17 Fig 3-20 [ A Binary to Decimal Decoder circuit using NAND gate ] : ................................................... 17 3-4 EXCLUSIVE-LOGIC-GATES: .................................................................................................................... 18 3-4-1 THE XOR GATE [ ]: .................................................................................................... 18

Example of Odd Number Of 1s : .................................................................................................. 18 Figure 3-21 The Exclusive-OR (XOR) Gate: ......................................................................................... 19 3-4-2 THE XNOR GATE [or EXCLUSIVE-NOR GATE ] ;:- .......................................................................... 19 Fig # 3-23 [ the Exclusive-NOR ( XNOR ) Gate ] ................................................................................... 20 Example of Evan Number of 1s : .................................................................................................... 20 Example # TGS : list the outputs you would expect for all possible inputs to a three input XOR gate ? ................................................................................................................................................................ 21 Fig for example # TGS......................................................................................................................... 21

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 2-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


Fig # TGS-1 [or Fig # 3-24 ] for example # TGS-1 , a Phase detector circuit using an XOR and XNor gate :- .................................................................................................................................................. 22 Fig # A1 [ build a circuit which switch between XOR and XNOR gate functions :-............................. 23

LOGIC-GATES: INTRODUCTION: Logic-Gate Circuits: Circuits containing predictable gate functions that either open or close their outputs. HARDWARE: A term used to describe the electronic, magnetic and mechanical devices of a digital system. SOFTWARE: A term used to describe the binary instructions and data processed by digital electronics system hardware. Within any digital electronic system you will find that diodes and transistors are used to construct logic gate circuits. Logic gates are in turn used to construct flip-flop circuits, & flip-flops are used to construct register[example: shift-register],counters,& a variety of other circuits. These logic gates , therefore, are used as the basic building blocks for all digital circuits, and their purpose is to control the movement of binary data & binary instructions. Logic gates, & all other digital electronic circuits , are often referred to as hardware circuits. By definition, the hardware of a digital electronic system includes all of the electronic, magnetic and mechanical devices of a digital system. In contrast, the software of a digital electronic system includes the binary data (like pure binary and ASCII codes) and binary instructions that are processed by the digital electronic system hardware. To use an analogy, we could say that a compact disk player is hardware, and the music information stored on a compact disk and processed by the player is software.
WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI Page 3-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


Just as a CD player is useless without CDs , a digital system hardware is useless without software. In other words , the information on the CD determines what music is played, and similarly the digital software determines the actions of the digital electronic hardware. Every digital electronic circuit uses logic-gate circuits to manipulate the coded pulses of binary language. These logic gate circuits are constructed using diodes and transistors, and they are the basic decision-making elements in all digital circuits. In this chapter we will begin by discussing the evolution of the electronic switch, and then show how diode and transistor switches are used to construct these digital logic gate hardware circuits. (3-1) HARDWARE FOR BINARY SYSTEMS: Digital circuits are often referred to as switching circuits because their control devices (diode and transistors ) are switched between[ b/w] the two extremes of ON and OFF. These digital circuits are also called two-state circuits because their control devices are driven into one of two states: either into the saturation state {fully ON ) , or at Cut-Off state (Fully OFF ) . These two modes of operation are used to represent the two binary digits of 1 and 0. To develop a digital electronic system that could manipulate binary information, inventors need a two-state electronic switch. Early machines used mechanical switches and electromechanical relays, to represent binary data by switching current ON or OFF . Two-state Circuits: switching circuits that are controlled to be either ON or OFF. These mechanical devices were eventually replaced by the Vacuum tube, which unlike switches and relays, had the advantage of no moving parts

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 4-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


The vacuum tube , however, was bulky, fragile, had to warm up and consumed an enormous amount of power. Finally, compact and low-power digital electronic circuits an d system became a reality with the development of semiconductor diode and transistors switches, letus see how we can use these semiconductor switches to construct a logic gate. (3-1-1 ) USING THE DIODE TO CONSTRUCT A LOGIC GATE:

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 5-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Fig 3-2 the Diode being used in a Digital Electronic Circuit. 3-1-2 USING THE TRANSISTOR TO CONSTRUCT A LOGIC GATE: NOT [ or Inverter ]-gate : A logic gate with only one input and one output that will invert the binary input [ ]; .

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 6-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

3-2 BASIC LOGIC GATES:i. The OR-gate: the OR-gate can have the two or more inputs, but will always have a single output. [ or A logic gate that will give a High output if either of its inputs are high. ] ii. The AND Gate: A logic gate that will give a High output only if all inputs are High [or like the OR-gate, an AND-Gate can have two or more inputs, but will always have a single output].

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 7-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


iii. Truth table [Or Function-table }: A table used to show the action of a device as it reacts to all possible input combinations.

Fig # 3-4 : The OR-Gate :

--------------- x= total number of i/p [inputs] to a logic gate.

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 8-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


Countmax = maximum count = =total number of counts by a logic gate . = Total Number of Possible Input combinations . {:. 2 is include because we are dealing with a Base-2 number system. } ---------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 9-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


Fig # 3-8 The AND Gate :

--------Example : for a five input AND gate, indicate the range of values within the truth table.? Solution: The Number Of Possible Input Combinations Will be : [ ];

Where: Number of Inputs are [ x=5 ]. So, [ For Range Of value : CountMAX = ---------finished-here----------Example : Referring to the circuit in figure 3-10 (a) , describe what would be present at the output of AND gate for each of the Control switch positions.? Solution: . ];

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 10-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

------finished-here-----------Controlled Switch : An electronically controlled switch. -------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 11-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


3-3 INVERTING LOGIC GATES [ NOT, NAND , NOR GATES ]: Although the basic OR and AND logic gates can be used to construct many digital circuits , in some circuits applications other logic operations are needed. For this reason , semiconductor manufactures made other logic-gate types available. In this section, we will examine three inverting-type logic gates, called the NOT-Gate, the NOR gate , and the NAND gate . We will begin with the NOT or Inverter gate , which was introduced earlier.. 3-3-1 THE NOT GATE : The NOT [ or logic Inverter ] gate , is the simplest of all the logic gates because it has only one input and one output.

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 12-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

-------------------------finished-here------------Complement=Opposite. Bubble [small-circle ] : a small circle symbol used to signify an invert function. -------------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 13-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


3-3-2 THE NOR GATE: A Not OR gate that will give a Low output if any of its inputs are High [or the name NOR is a combination of the two words NOT and OR , and is used to describe a type of logic gate that contains an OR gate followed by a NOT gate , as shown in figure 3-15(a) ].

Fig 3-15 THE NOR Gate : -------------------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 14-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


EXAMPLE : [FREQUENCY -SELECTOR / DATA-SELECTOR / MULTIPLEXER CIRCUIT ]: Referring to the circuit shown in figure 3-17, find whether the LED will flash at a rate of 1 Hz or 2 Hz for the inputs and switch position shown ? Solution: Answer is given in fig # 3-17 below.

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 15-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


FIG # 3-17 A DATA-SELECTOR/MULTIPLEXER/FREQUENCY SELECTOR CIRCUIT: ----finished-here------------3-3-3 : THE NAND GATE: A NOT-AND logic gate circuit that will give a High output if any of its inputs are Low [ like NOR, the name NAND is a combination of the two words NOT and AND , and it describes another type of logic gate that contains an AND gate followed by a NOT gate , as shown in fig 3-18(a)].

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 16-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


FIG # 3-18 the NAND Gate:

-------EXAMPLE : which of the LEDs in figure 3-20 would turn ON, if the binary inputs at A and B were both High? Solution: Decimal LED # 3 will turn ON when inputs A and B were high .

Fig 3-20 [ A Binary to Decimal Decoder circuit using NAND gate ] : --------finished-here----

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 17-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


3-4 EXCLUSIVE-LOGIC-GATES: In this section , we will discuss the final two logic gate types: the exclusiveOR ( XOR ) gate and Exclusive-NOR (XNOR) gate. Although these two logic gates are not used as frequently as the five basic OR ,AND , NOT, NOR and NAND gates, their function is ideal in some circuits applications. 3-4-1 THE XOR GATE [ ]: EXCLUSIVE-OR Gate [ XOR-Gate ]: A logic gate circuit that will given a High output if any Odd number of binary 1s are applied to the input. [ example of odd number of 1s is [ ]]. XOR GATE [ ]; Example of Odd Number Of 1s : i. 1+0=1s 1+0=1 ; [ Odd number of 1s ]. ii. 1+1+1=1s 1+1+1=3 ; [ Odd number of 1s ]. iii. 1+1+1+1+1=1s 1+1+1+1+1=5 ; [ Odd number of 1s ]. iv. 1+1+1+1+1+1+1=1s 1+1+1+1+1+1+1=7 ; [ Odd number of 1s ].

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 18-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Figure 3-21 The Exclusive-OR (XOR) Gate: -------------finished-here---------3-4-2 THE XNOR GATE [or EXCLUSIVE-NOR GATE ] ;: The XNOR gate , is simply an XOR gate followed by a NOT gate, as shown in figure 3-23 (a). [ or A Not Exclusive OR gate that will give a High Output if any even Number of binary 1s are applied to the input. ]; Comparing the XOR gate to the XNOR gate , the XOR gate outputs is only high when there is an odd number of binary 1s at input , whereas with the XNOR gate , the output is only high when there is an even number of binary 1s at the inputs. XNOR GATE [ ];

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 19-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Fig # 3-23 [ the Exclusive-NOR ( XNOR ) Gate ] Example of Evan Number of 1s : i. 0+0=0s 0+0=0 ; [ Even number of 1s ]. ii. 1+1=1s 1+1=2 ; [ Even number of 1s ]. iii. 1+1+1+1=1s 1+1+1+1=4 ; [ Even number of 1s ]. iv. 1+1+1+1+1+1=1s 1+1+1+1+1+1=6 ; [ Even number of 1s ].

------------------finished-here---------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 20-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]


Example # TGS : list the outputs you would expect for all possible inputs to a three input XOR gate ? Solution:

Fig for example # TGS Key conclusion: the output is only 1 when there is an Odd Number of Binary 1s at the inputs applied . -------------finishedhere-------Example # TGS-1 : what will be the X and Y outputs from the circuit in figure of ex # TGS-1 , if the A and B inputs are either out-of-Phase or in-Phase ? Solution:

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 21-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Fig # TGS-1 [or Fig # 3-24 ] for example # TGS-1 , a Phase detector circuit using an XOR and XNor gate :-----------------finished-here------------

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 22-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

Fig # A1 [ build a circuit which switch between XOR and XNOR gate functions :---------------finished-here------------

-----------------this Chapter # 3 , on Logic-gates finished-here on Digital-electronics, in Bio-medical-Engineering under-graduate course-------------

X
MOHAMMAD-SIKANDAR-KHAN-LODHI OWNER-OF-MY-PERSONAL-NOTES

Wednesday, June 05, 2013

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 23-OF-22

[DIGITAL-ELECTRONICS IN BIO-MEDICAL ENGINEERING, CH-3: LOGIC-GATES ]

WWW.MEDICAL-IMAGE-PROCESSING.BLOGSPOT.CA BY SIKANDAR-LODHI

Page 24-OF-22

Das könnte Ihnen auch gefallen