390 likes | 469 Views
Engineering 43. Boolean Logic Systems. Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu. Analog vs Digital. Up to know we have examined ANALOG systems In Analog systems the Quantity of Interest (I or V usually) Varies continuously with time → U = f ( t )
E N D
Engineering 43 BooleanLogic Systems Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu
Analog vs Digital • Up to know we have examined ANALOG systems • In Analog systems the Quantity of Interest (I or V usually) Varies continuously with time → U = f(t) • In the Analog case U plots as a smooth curve vs t • Digital signals are discontinuous in time; ocassionallydU/dt → ∞ (in theory)
Analog vs Digital Smoothly Varying Curve Analog Vertical Rises & Falls, Flat Tops & Bottoms Digital
U Binary vsMultiLevel Digital 1 t • BInary → TWO Level (0/1, Lo/Hi, N/Y) with “Bits” (Binary Digits): U • TRInary → THREE Level (−1/0/1, Lo/Med/Hi) with “TRITS”: 1 t −1 Zero Levels are Significant
Binary Logic • Virtually ALL Electronic-Computer Logic is BINARY. • But the Signals are not always “Clean” • A Margin for Error to account for Noisy Signals is called the “Noise Margin” • A Good “NM” allows a weak INput to make a strong Output
Binary Logic Noise Margains • The NOISE MARGIN is parameter that determines the maximum noise voltage on the input of a gate that allows the output to remain stable. • Two parameters, Low noise margin (NML) and High noise margin (NMH).
Binary Noise Margins • By the Diagram Above • Inputs in the range VIHmin<Vin<VILmax Produce Unpredictable Results
Numbering Systems • Numbering Systems (bases) used in Electronic Systems • Binary, Base-2 • Octal, Base-8 • Decimal, Base-10 (Human Base) • Hexadecimal, Base-16 (Digit “F16” = 1510) • Examples 46237in Decimal • → 168310
Numbering Systems Base 10 Base 2 Base 16
Counting: Decimal vs Binary • NOTE that 2510 = 110012
Decimal to Binary Conversion • Method-A Sucesive Divisions Convert the decimal number 192 into a binary number. 192/2= 96 with a remainder of 0 96/2= 48 with a remainder of 0 48/2= 24 with a remainder of 0 24/2= 12 with a remainder of 0 12/2= 6 with a remainder of 0 6/2= 3 with a remainder of 0 3/2= 1 with a remainder of 1 1/2= 0 with a remainder of 1 Write down all the REMAINDERS, backwards, and you have thebinary number 11000000.
Decimal to Binary Conversion • Method-B Successive Subtractions Convert the decimal number 192 into a binary number. First find the largest number that is a power of 2 that you can subtract from the original number. Repeat the process until there is nothing left to subtract. 192−128 = 64 128’s (27)used 1 • 64 − 64 = 0 64’s (26) used 1 0 − 0 = 0 32’s (26) used 0 • 0 − 0 = 0 16’s (24) used 0 • 0 − 0 = 0 8’s (23) used 0 • 0 − 0 = 0 4’s (22) used 0 • 0 − 0 = 0 2’s (21) used 0 • 0 − 0 = 0 1’s (20) used 0 Write down the 0s & 1s from top to bottom, and you have the binary number 11000000.
Example: Successive Subtracts • Successive subtraction is more intuitive Convert the decimal number 213 into a binary number. First find the largest number that is a power of 2 that you can subtract from the original number. Repeat the process until there is nothing left to subtract. • 213-128 = 85 128’s (27) used 1 • 85-64 = 21 64’s (26) used 1 • *(32 cannot be subtracted from 21)32’s (25) used 0 • 21-16 = 5 16’s (24) used 1 • *(8 cannot be subtracted from 5)8’s (23) used 0 • 5-4= 1 4’s (22) used 1 • *(2 cannot be subtracted from 1)2’s (21) used 0 • 1-1 = 0 1’s (20) used 1 Write down the 0s & 1s from top to bottom, and you have the binary number 11010101.
Binary to Decimal Conversion • Method-B Sucessive Additions • Make a “Power of 2” table. From right to left, write the values of the power of 2 above each binary number. Then add up the values where a 1 exists. Ex: 101101012 128 + 32 + 16 + 4 + 1 = 181
Fractional Binary to Decimal • Method-B Successive Additions • Treat Factions the Same way as Integers using successive Additions. Ex: 0.10011012 0.5 + 0.0625 + 0.03125 + 0.015625 + 0.0390625 = 0.6133
Fractional Decimal to Binary • 0.41710 to N2 by Successive Subtract • Thus after getting to the High-Precision of 7 Sig-Figs Find • Luckily Fractional Conversions are not often need
Base-16 • The Numbers in Base-16 run 0→15 in Decimal • How do we WRITE 1310 in Base-16 (ONE Symbol) when we’re used to 0→9? • Answer: use LETTERS to represent 10→15
Hexadecimal to Decimal • Convert 12B16 to Decimal • Base16Table • Each number-place represents a power of 16 • Given the hexadecimal number 12B • 1 X 256 = 256 • 2 X 16 = +32 • B X 1 = +11 (B = 11 in hex) 299
HexaDecimal Numbering • Hexadecimal is the numbering system that is used to represent MAC (Media Access Control) for Internet addresses for example • Another Conversion Example: Express 2F5A16 as a decimal number (2 x 4096) + ([F]15 x 256) + (5 x 16) + ([A]10 x 1) = 12122
HexaDecimal Numbering • One hexadecimal character can represent any decimal number between 0 and 15. • In binary, F (15 decimal) is 1111 and A (10 decimal) is 1010. • It follows that 4 bits are required to represent a single hexadecimal value in binary. • A MAC address is 48 bits long (6 bytes), which translates to (48/4 = ) 12 hexadecimal characters required to express a MAC address. • You can check YOUR MAC-ID by typing cmd.exe in Windows-7, and then type in the BlackBoxipconfig/all
MAC ID Example • After typing in the Windows “Start Box”: • cmd.exe • ipconfig/all
HexaDecimal Numbering • The smallest decimal value that can be represented by four hexadecimal characters (0000) is 0. • The largest decimal value that can be represented by four hexadecimal characters (FFFF) is 65,535. • It follows that the range of decimal numbers that can be represented by four hexadecimal characters (16 bits) is 0 to 65,535, a total of 65,536 or 216 possible values.
Combinatorial Logic Circuits • The Foundation of Algebra, apart from number themselves, depends on only THREE Operations • Negation • Addition (OR-ing) • Multiplication (AND-ing) • Electronic Circuits can easily implement • Inversion • OR operations • AND operations
The Five Base Logic Gates • The Operation of Logic Gates is Described in TRUTH TABLES • Truth Tables Show the OutPut of a Gate as function ONLY of its Inputs • For Example: Inversion or “NOT-ing” • Notice the Logic Gate SYMBOL for an Inverter • The Triangle with the Bubble
The Five Base Logic Gates • Inverters performs Negation • AND gates perform Multiplication • OR Gates Implement the ADDITION operation
The Five Basic Logic Gates • The INVERTED form of an AND is called a Not-AND or NAND. The Truth Table: • The INVERTED form of an OR is called a Not-OR or NOR. The Truth Table:
PSPICE Gates • PSPICE-Student has 4 of the 5 Base-Gates as Built-In Parts • NAND → 7400 • NOR → 7402 • INVERT → 7404 • AND → 7408
The Inversion “Bubble” • The presence of a “Bubble” implies Inversion • For example, a bubble turns a BUFFER into an INVERTER • The Bubble Inverts INPUTS as well as Outputs
The EXCLUSIVE GATES • The OR gate produces a “1” for one or two high inputs • The Exclusive-OR allows only one High • The NOR OR gate produces a “0” for one to two low inputs • The Exclusive-NOR allows only one LOW
NANDs (or NORs) are Enough • To Build a Functioning logic System Need only: IVERSION, AND, OR (alternatively inversion ,nand , nor) • NANDs and NORs are MUCH easier to make than ANDs and NORs. • Thus make Invertors ANDs & ORs from NANDS or NORs • NANDS preferred
WhiteBoard Work • Determine the TRUTH TABLE for • Need 24 (16) entries on the Truth Table • Next time Write an Equation for the TT
All Done for Today Media AccessControl A Hexadecimal Number (Note the “E”)
Engineering 43 AppendixNAND Bruce Mayer, PE Licensed Electrical & Mechanical EngineerBMayer@ChabotCollege.edu
Solution by MATLAB % Bruce Mayer, PE % ENGR43 * 25Mar12 % Lec-7a * TruthTableWhiteBoard Problem % file = Truth_Table_Lec7a_1203.m % k = 0; % initialize Vector Counter for A = 0:1; for B = 0:1; for C = 0:1; for D = 0:1; k = k+1; Ai(k) = A; Bi(k) = B; Ci(k) = C; Di(k) = D; Out(k) = ~C&~D | C&D | A&B&D; end end end end % Truth_tbl =[Ai',Bi',Ci',Di',Out']; % disp(' A B C D Out') disp('==================================') disp(Truth_tbl) OutVert = Out'; %debug command A B C D Out ================================ 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1 1 0 1 0 0 1 0 1 0 1 0 0 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 1 1 0 0 1 1 1 0 1 1 1 1 1 0 0 1 1 1 1 1