Introduction to Digital Logic
|
|
- Brianna Hubbard
- 6 years ago
- Views:
Transcription
1 Introduction to Digital Logic Lecture 15: Comparators
2 EXERCISES Mark Redekopp, All rights reserved
3 Adding Many Bits You know that an FA adds X + Y + Ci Use FA and/or HA components to add 4 individual bits: W + X + Y + Z X Y C out Full Adder S C in
4 Adding 3 Numbers Add X[3:] + Y[3:] + Z[3:] to produce F[?:] using the adders shown plus any FA and HA components you need 11 B3 C A3 S B2 14 A2 S B A1 S1 1 6 B 5 A S 4 7 C C A B A1 B1 A2 B2 A3 B3 283 S 4 S1 1 S2 13 S3 1 C4 9
5 Mapping Algorithms to HW Wherever an if..then..else statement is used usually requires a mux if(a[3:] > B[3:]) Z = A+2 else Z = B+5 B[3:] 11 A[3:] 1 A[3:] B[3:] Adder Circuit Adder Circuit Comparison Circuit I I 1 Y S Z[3:]
6 Mapping Algorithms to HW Wherever an if..then..else statement is used usually requires a mux if(a[3:] > B[3:]) Z = A+2 else Z = B+5 B[3:] A[3:] 11 1 A[3:] B[3:] I I 1 I I 1 S S Y Y Comparison Circuit Adder Circuit Z[3:]
7 Adder / Subtractor If sub/~add = 1 Z = X[3:]-Y[3:] Else Z = X[3:]+Y[3:] I1 I I1 I I1 I I1 I S S S S Y Y Y Y B3 B2 B1 B A3 A2 A1 A C4 4-bit Binary Adder C S3 S2 S1 S
8 Adder / Subtractor If sub/~add = 1 Z = X[3:]-Y[3:] SUB/~ADD Else C Z = X[3:]+Y[3:] SUB/ ~ADD Yi 1 1 Bi Y Y1 Y2 Y3 X X1 X2 X3 A A1 A2 A3 B B1 B2 B3 C4 4-bit Binary Adder S3 S2 S1 S Z Z1 Z2 Z3 1 1 SUB/~ADD
9 Adder / Subtractor X + 5, when A5,M1 = 1, Z = X 1, when A5,M1 =,1 X, when A5,M1 =, C M1 A5 X X1 X2 X3 B3 B2 B1 B A3 A2 A1 A C4 4-bit Binary Adder S3 S2 S1 S Z Z1 Z2 Z3
10 Multiplication By Powers of 2 In decimal, multiplication by 1 n can easily be achieved by adding n s to the right of the number 937 * 1 = 937 * 1 2 = 93,7 145 * 1 = 145 * 1 4 = 1,45, In binary, multiplication by 2 n can easily be achieved by adding n s to the right of the number 3 1 = = 3*2 1 = = 3*2 2 = = 3*2 3 = 11 2
11 Division By Powers of 2 In decimal, division by 1 n can easily be achieved by shifting the decimal point n places to the left 937 / 1 = 937 / 1 2 = ,768 * 1 = 145,768 / 1 4 = In binary, division by 2 n can easily be achieved by shifting the decimal point n places to the left 12 1 = 11 => 12/2 1 = = = 11 => 12/2 2 = = = 111 => 7/2 1 = = 3.5
12 Constant Multiplication w/ Adders Design a circuit to calculate Y = 1X, where X is a 4-bit unsigned number (1 1 is a constant) Break it down to powers of 2 (e.g. 1X = 8X+2X) Recall, multiplying by a power of 2 is equal to shifting X to the left that number of bits (i.e. 8X is just X shifted to the left 3 places) if X = 11 2 = 3 1 8X = 11 2 = X = 11 2 = = 8X + 11 = 2X 1111 = 1X
13 Constant Multiplication w/ Adders Design a circuit to calculate Y = 1X, where X is a 4-bit unsigned number (1 1 is a constant) Break it down to powers of 2 (e.g. 1X = 8X+2X) Recall, multiplying by a power of 2 is equal to shifting X to the left that number of bits (i.e. 8X is just X shifted to the left 3 places) if X = 11 2 = 3 1 8X = 11 2 = X = 11 2 = = 8X + 11 = 2X 1111 = 1X
14 Performing Multiplication w/ Adders How many 4-bit adders do we need? X 3 X 2 X 1 X = 8X + X 3 X 2 X 1 X = 2X Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y 1 Y = 1X
15 Performing Multiplication w/ Adders To implement using 4-bit adders, Assume 4-bit number X = X 3 X 2 X 1 X These are the bits that need to be added X 3 X 2 X 1 X = 8X + X 3 X 2 X 1 X = 2X Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y 1 Y = 1X We don t need an adder to figure out what the sum of these 3 columns are because we re adding with
16 Y = 1*X Circuit X 3 X 2 X 1 X x 3 x 2 x 1 x 3 x x 2 X 1 X C out B 3 B 2 B 1 A B C in S 3 S 2 S 1 S Y 7 Y 6 Y 5 Y 4 Y 3 Y 2 Y 1 Y
17 COMPARATORS Mark Redekopp, All rights reserved
18 Comparators Compare two numbers and produce relational conditions,,, A B, and A B Suppose we want to compare two, 4-bit numbers: A[3:] and B[3:] Too big to build directly decompose the problem Compare: A3 A2 A1 A B3 B2 B1 B
19 Start Easy Build a circuit to compare a bit, A, with a bit, B The only way one bit, A, can be greater than another bit, B, is if A=1 and B= The only way one bit, A, can be less than another bit, B, is if A= and B=1 A and B are equal when they are the same A B 1 A B X Y A B Comp. GT EQ LT Mark Redekopp, All rights reserved XNOR A B A B A B
20 4-bit Comparator A3 B3 A2 B2 A1 B1 A B X Y X Y X Y X Y Comp. Comp. Comp. Comp. GT EQ LT GT EQ LT GT EQ LT GT EQ LT Merger
21 Merging Comparison Results Suppose we have the comparison results of individual digits of a 2-digit number, how can we combine them to produce the overall result? Key: More significant digits/bits fully determine results of overall comparison unless they are equal in which case we use the result of the less significant digits A=(9 3) 1 B=(7 8) 1 MSD: 9 > 7 LSD: 3 < 8 Overall? A > B (9x > 7x)
22 Greater-Than, Less-Than, Equal Find an algorithm to check whether one decimal number is greater than, less than, or equal to another 837 > 756 Start with the MSD, 8 > 7 and you re done any number with 8 in the 1 s place is greater than a number with 7 in the 1 s place 621 < 649 Start with the MSD, 6 = 6 you can t tell yet which is greater or less than so move to the next digit 2 < 4 and you re done 62x is always less than 64x Algorithm: Start with the MSD and keep comparing digits to the right. Once any digit of A is > or < corresponding digit of B then you know the whole number A > B or A < B, respectively. If all digits are equal then both number are equal.
23 Merging Results MS Digit Results LS Digit Results Outputs (MS) (MS) (MS) (LS) (LS) (LS) A > B A< B A = B Mark Redekopp, All rights reserved A=(9 3) 1 B=(7 8) 1 MSD: 9 > 7 LSD: 3 < 8 Overall?
24 Merging Results MS Digit Results LS Digit Results Outputs (MS) (MS) (MS) (LS) (LS) (LS) A > B A< B A = B 1 X X X 1 1 X X X Mark Redekopp, All rights reserved A=(9 3) 1 B=(7 8) 1 MSD: 9 > 7 LSD: 3 < 8 Overall?
25 Merging Logic MS Digit Results LS Digit Results Outputs MGT MLT MEQ LGT LLT LEQ GT LT EQ 1 X X X 1 1 X X X GT = MGT + MEQ LGT LT = MLT + MEQ LLT EQ = MEQ LEQ MGT MEQ MLT GT EQ LT. Merger LGT LEQ LLT
26 4-bit Comparator A3 B3 A2 B2 A1 B1 A B X Y X Y X Y X Y Comp. Comp. Comp. Comp. GT EQ LT GT EQ LT GT EQ LT GT EQ LT MGT MEQ MLT MGT MEQ MLT MGT MEQ MLT MGT MEQ MLT GT EQ LT. Merger LGT LEQ LLT GT EQ LT. Merger LGT LEQ LLT GT EQ LT. Merger LGT LEQ LLT GT EQ LT. Merger LGT LEQ LLT 1 Delay: Linear in the length of the chain Mark Redekopp, All rights reserved Can we try to implement the merging in 2-levels?
27 4-bit Equality Check XNOR gate outputs 1 when two bits are equal A B A B XNOR To check whether two 4- bit numbers are equal use 4 XNOR gates to XNOR each pair of bits only if all the pairs are equal, are the 2 numbers equal (i.e. AND the outputs together) A B B 1 B 2 A =B =B 1 =B 2 =B 3 B 3
28 4-bit Greater-Than Consider 2 numbers A ( A ) and B (B 3 B 2 B 1 B ) There are 4 cases for when A > B > B 3 and who cares about the other bits = B 3, > B 2 and the other bits don t matter = B 3, = B 2, > B 1 and the other bits don t matter = B 3, = B 2, = B 1, A > B Case 1 Case 2 Case 3 Case 4 1xxx = A 1xx = A 111x = A 1 = A xxx = B xx = B 11x = B = B
29 4-bit Less-Than The same style algorithm can be used to check for less-than. There are 4 cases for when A < B < B 3 and who cares about the other bits = B 3, < B 2 and the other bits don t matter = B 3, = B 2, < B 1 and the other bits don t matter = B 3, = B 2, = B 1, A < B Case 1 Case 2 Case 3 Case 4 xxx = A xx = A 11x = A = A 1xxx = B 1xx = B 111x = B 1 = B
30 4-bit Comparator A3 B3 A2 B2 A1 B1 A B X Y X Y X Y X Y Comp. Comp. Comp. Comp. GT EQ LT GT EQ LT GT EQ LT GT EQ LT GT3 LT3 EQ3
31 4-bit Cascabable Comparator (74LS85) 4-bit Magnitude Comparator (Non-cascadable) A B A B 1-bit comparator LT GT EQ A1 B1 A B 1-bit comparator LT1 GT1 EQ1 A2 B2 A B 1-bit comparator LT2 GT2 EQ2 A3 B3 A B 1-bit comparator LT3 GT3 EQ3 of LSB s of LSB s of LSB s
32 Less-Than Rather than using the previous logic, put less-than in terms of equal and greaterthan = () ()
33 4-bit Magnitude Comparator A A =B B B 1 =B 1 =B 2 B 2 B 3 =B 3 B 3 B 2 B 1 A B
34 4-bit Magnitude Comparator A A =B B B 1 B 2 B 3 =B 3 =B 1 =B 2 A 4-bit Magnitude Comparator B 3 B B 2 B 1 B 2 B 1 B 3 A B
35 4-bit Magnitude Comparator A 4-bit Magnitude Comparator B B 1 B 2 B 3
36 Building Larger Comparators Try to build an 8-bit comparator Can we chain cascade (chain) together 4-bit magnitude comparators? Try to connect 4-bits of each input to a 4-bit comparator Problem: No way to communicate results of lower bits to higher bit comparator -A A 4-bit Magnitude Comparator A LSB < B LSB A LSB = B LSB A 7 -A 4 A 4-bit Magnitude Comparator A MSB < B MSB A MSB = B MSB B B B 3 -B B 1 B 2 A LSB > B LSB B 7 -B 4 B 1 B 2 A MSB > B MSB B 3 B 3 LSB s of A,B MSB s of A,B
37 Building Larger Comparators Remember if the MSB s of A are Greater-Than or Less-Than MSB s of B we don t need to look at LSB s Only when MSB s of A = MSB s of B do we need to look at the relationship of the LSB s MSB s of A > MSB s of B 11 xxxx = A 11 xxxx = B MSB s of A < MSB s of B 1 xxxx = A 111 xxxx = B MSB s of A = MSB s of B = A 11 1 = B A > B LSB s don t matter A < B LSB s don t matter Relationship of LSB s is now needed to find out whether,,
38 Building Larger Comparators Just add one of our merger circuits -A LSB s of A,B A 4-bit Magnitude Comparator LLT LEQ A 7 -A 4 MSB s of A,B A 4-bit Magnitude Comparator MLT MEQ B 3 -B B B 1 B 2 LGT B 7 -B 4 B B 1 B 2 MGT B 3 B 3 MLT MEQ MGT LGT LEQ LLT. Merger GT EQ LT
39 Building Larger Comparators Just add one of our merger circuits -A LSB s of A,B A 4-bit Magnitude Comparator LLT LEQ A 7 -A 4 A Mid Bits of A,B 4-bit Magnitude Comparator MidLT MidEQ 1 -A 8 MSB's of A,B A 4-bit Magnitude Comparator MLT MEQ B 3 -B B B 1 B 2 LGT B 7 -B 4 B B 1 B 2 MidGT B 11 -B 8 B B 1 B 2 MGT B 3 B 3 B 3 To make a block that can be repeated and chained arbitrarily, cut the design as shown: MLT MEQ MGT LGT LEQ LLT. Merger GT EQ LT MLT MEQ MGT LGT LEQ LLT. Merger GT EQ LT
40 Building Larger Comparators Solution: Add cascade inputs I, I, I, to each 4-bit comparator where the comparison of LSB s can be connected Cascaded inputs will only be passed when the MSB s are equal A A Comparison of less significant bits B B 1 74LS85 O O Comparison of more significant bits B B 1 74LS85 O O Overall comparison result B 2 B 2 B 3 O B 3 O I I I New cascaded inputs I I I Only use these inputs when MSB s are equal
41 4-bit Cascadable Comparator Below is the logic needed to add these cascaded inputs A A O O B B 1 B 2 B B 1 B 2 4-bit Magnitude Comparator O B 3 B 3 I I I
42 4-bit Cascadable Comparator Below is the logic needed to add these cascaded inputs A A O O B B 1 B 2 B B 1 B 2 4-bit Magnitude Comparator O B 3 I I B 3 Notice that all 3 of the cascaded inputs are qualified with from the MSB s. When =, the cascaded inputs are forced to I
43 4-bit Cascadable Comparator Below is the logic needed to add these cascaded inputs A A O O B B 1 B 2 B B 1 B 2 4-bit Magnitude Comparator O B 3 I I I B 3 If the MSB s of A are > or < the MSB s of B then the overall outputs are fully determined. Thus those outputs go into the final OR gate. If they are 1 then the output will be 1 no matter what the other input to the OR gate is.
44 Cascaded Comparator Example A = B = A O A O 1 1 B B 1 B 2 B 3 74LS85 O O B B 1 B 2 B 3 74LS85 O O 1 use initial values of 1 I I I I I I these input values have lower priority Since the MSB s of A > MSB s of B we don t need the results of the LSB comparator.
45 Cascaded Comparator Example A = B = A O A O B B 1 B 2 B 3 74LS85 O O B B 1 B 2 B 3 74LS85 O O use initial values of 1 I I I I I I these input values have lower priority Since the MSB s of A = MSB s of B the comparison of the LSB s determines the final output
46 XOR APPLICATIONS Mark Redekopp, All rights reserved
47 XOR Gate Review X Y Z XOR Z X Y X Y Z True if an odd # of inputs are true 2 input case: True if inputs are different
48 XOR Conditional Inverter If one input to an XOR gate is, the other input is passed If one input to an XOR gate is 1, the other input is inverted Use one input as a control input which can conditionally pass or invert the other input X Y Z Y Y
49 XOR / XNOR Equivalents XOR gate with Odd number of input/output inversions => XNOR gate Even number of input/output inversions => XOR gate X Y Z
50 Parity & Error Detection When digital data is transmitted there is some probability that a bit will be corrupted (flipped) We d like a way to detect an error so that the receiver can ask for a retransmission rather than using the wrong data We will attach an extra parity bit, P, to the data to help determine if there is an error A 111 P 11 P B
51 Even & Odd Parity Even Parity: All transmissions will contain an even number of 1 s We will choose even parity in example below Odd Parity: All transmissions will contain an odd number of 1 s A B Make P=1 to ensure even # of 1 s Receiver sees odd # of 1 s and knows there is an error
52 Generating & Checking Parity To generate even parity bit P at sender: P = 1 when odd number of 1 s in data This is nothing more than an XOR function To check if error at receiver Error = 1 when odd number of 1 s in data and parity bit message Again, nothing more than an XOR function A B
ELCT201: DIGITAL LOGIC DESIGN
ELCT2: DIGITAL LOGIC DESIGN Dr. Eng. Haitham Omran, haitham.omran@guc.edu.eg Dr. Eng. Wassim Alexan, wassim.joseph@guc.edu.eg Lecture 4 Following the slides of Dr. Ahmed H. Madian محرم 439 ه Winter 28
More informationCombinational Logic Design Arithmetic Functions and Circuits
Combinational Logic Design Arithmetic Functions and Circuits Overview Binary Addition Half Adder Full Adder Ripple Carry Adder Carry Look-ahead Adder Binary Subtraction Binary Subtractor Binary Adder-Subtractor
More informationECE380 Digital Logic. Positional representation
ECE380 Digital Logic Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Dr. D. J. Jackson Lecture 16-1 Positional representation First consider integers Begin with
More informationCombina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge
Combina-onal Logic Chapter 4 EECE 256 Dr. Sidney Fels Steven Oldridge Topics Combina-onal circuits Combina-onal analysis Design procedure simple combined to make complex adders, subtractors, converters
More informationLogic. Combinational. inputs. outputs. the result. system can
Digital Electronics Combinational Logic Functions Digital logic circuits can be classified as either combinational or sequential circuits. A combinational circuit is one where the output at any time depends
More informationCarry Look Ahead Adders
Carry Look Ahead Adders Lesson Objectives: The objectives of this lesson are to learn about: 1. Carry Look Ahead Adder circuit. 2. Binary Parallel Adder/Subtractor circuit. 3. BCD adder circuit. 4. Binary
More informationXOR - XNOR Gates. The graphic symbol and truth table of XOR gate is shown in the figure.
XOR - XNOR Gates Lesson Objectives: In addition to AND, OR, NOT, NAND and NOR gates, exclusive-or (XOR) and exclusive-nor (XNOR) gates are also used in the design of digital circuits. These have special
More informationSystems I: Computer Organization and Architecture
Systems I: Computer Organization and Architecture Lecture 6 - Combinational Logic Introduction A combinational circuit consists of input variables, logic gates, and output variables. The logic gates accept
More informationAdditional Gates COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals
Additional Gates COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals Presentation Outline Additional Gates and Symbols Universality of NAND and NOR gates NAND-NAND
More informationCombinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan
Combinational Logic Mantıksal Tasarım BBM23 section instructor: Ufuk Çelikcan Classification. Combinational no memory outputs depends on only the present inputs expressed by Boolean functions 2. Sequential
More informationFundamentals of Digital Design
Fundamentals of Digital Design Digital Radiation Measurement and Spectroscopy NE/RHP 537 1 Binary Number System The binary numeral system, or base-2 number system, is a numeral system that represents numeric
More informationTotal Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20
University of Waterloo Department of Electrical & Computer Engineering E&CE 223 Digital Circuits and Systems Midterm Examination Instructor: M. Sachdev October 30th, 2006 Total Time = 90 Minutes, Total
More informationUNIT II COMBINATIONAL CIRCUITS:
UNIT II COMBINATIONAL CIRCUITS: INTRODUCTION: The digital system consists of two types of circuits, namely (i) (ii) Combinational circuits Sequential circuits Combinational circuit consists of logic gates
More informationUNIVERSITI TENAGA NASIONAL. College of Information Technology
UNIVERSITI TENAGA NASIONAL College of Information Technology BACHELOR OF COMPUTER SCIENCE (HONS.) FINAL EXAMINATION SEMESTER 2 2012/2013 DIGITAL SYSTEMS DESIGN (CSNB163) January 2013 Time allowed: 3 hours
More informationCS 140 Lecture 14 Standard Combinational Modules
CS 14 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris 1 Part III. Standard Modules A. Interconnect B. Operators. Adders Multiplier
More informationClass Website:
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #5 Instructor: Andrew B. Kahng (lecture) Email: abk@ece.ucsd.edu Telephone: 858-822-4884 office, 858-353-0550 cell Office:
More informationChapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.
Chapter 4 Dr. Panos Nasiopoulos Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. Sequential: In addition, they include storage elements Combinational
More informationLogic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits
Logic and Computer Design Fundamentals Chapter 5 Arithmetic Functions and Circuits Arithmetic functions Operate on binary vectors Use the same subfunction in each bit position Can design functional block
More informationHakim Weatherspoon CS 3410 Computer Science Cornell University
Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. memory inst 32 register
More informationLecture 2 Review on Digital Logic (Part 1)
Lecture 2 Review on Digital Logic (Part 1) Xuan Silvia Zhang Washington University in St. Louis http://classes.engineering.wustl.edu/ese461/ Grading Engagement 5% Review Quiz 10% Homework 10% Labs 40%
More informationUNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018
DIGITAL ELECTRONICS SYSTEM DESIGN LL 2018 PROFS. IRIS BAHAR & ROD BERESFORD NOVEMBER 9, 2018 LECTURE 19: BINARY ADDITION, UNSIGNED BINARY NUMBERS For the binary number b n-1 b n-2 b 1 b 0. b -1 b -2 b
More informationECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks
ECE 545 Digital System Design with VHDL Lecture Digital Logic Refresher Part A Combinational Logic Building Blocks Lecture Roadmap Combinational Logic Basic Logic Review Basic Gates De Morgan s Law Combinational
More informationECE 2300 Digital Logic & Computer Organization
ECE 23 Digital Logic & Computer Organization Spring 28 Combinational Building Blocks Lecture 5: Announcements Lab 2 prelab due tomorrow HW due Friday HW 2 to be posted on Thursday Lecture 4 to be replayed
More informationNumbers and Arithmetic
Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu
More informationSpiral 2-4. Function synthesis with: Muxes (Shannon's Theorem) Memories
2-4. Spiral 2-4 Function synthesis with: Muxes (Shannon's Theorem) Memories 2-4.2 Learning Outcomes I can implement logic for any truth table by using Shannon's theorem to decompose the function to create
More informationBinary addition by hand. Adding two bits
Chapter 3 Arithmetic is the most basic thing you can do with a computer We focus on addition, subtraction, multiplication and arithmetic-logic units, or ALUs, which are the heart of CPUs. ALU design Bit
More informationBinary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q
Digital Arithmetic In Chapter 2, we have discussed number systems such as binary, hexadecimal, decimal, and octal. We have also discussed sign representation techniques, for example, sign-bit representation
More informationECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks
ECE 545 Digital System Design with VHDL Lecture A Digital Logic Refresher Part A Combinational Logic Building Blocks Lecture Roadmap Combinational Logic Basic Logic Review Basic Gates De Morgan s Laws
More informationBINARY CODES. Binary Codes. Computer Mathematics I. Jiraporn Pooksook Department of Electrical and Computer Engineering Naresuan University
Binary Codes Computer Mathematics I Jiraporn Pooksook Department of Electrical and Computer Engineering Naresuan University BINARY CODES: BCD Binary Coded Decimal system is represented by a group of 4
More informationDigital Techniques. Figure 1: Block diagram of digital computer. Processor or Arithmetic logic unit ALU. Control Unit. Storage or memory unit
Digital Techniques 1. Binary System The digital computer is the best example of a digital system. A main characteristic of digital system is its ability to manipulate discrete elements of information.
More informationSpiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller
2-. piral 2- Datapath Components: Counters s Design Example: Crosswalk Controller 2-.2 piral Content Mapping piral Theory Combinational Design equential Design ystem Level Design Implementation and Tools
More informationDesign of Sequential Circuits
Design of Sequential Circuits Seven Steps: Construct a state diagram (showing contents of flip flop and inputs with next state) Assign letter variables to each flip flop and each input and output variable
More informationWe are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors
CSC258 Week 3 1 Logistics If you cannot login to MarkUs, email me your UTORID and name. Check lab marks on MarkUs, if it s recorded wrong, contact Larry within a week after the lab. Quiz 1 average: 86%
More informationModule 2. Basic Digital Building Blocks. Binary Arithmetic & Arithmetic Circuits Comparators, Decoders, Encoders, Multiplexors Flip-Flops
Module 2 asic Digital uilding locks Lecturer: Dr. Yongsheng Gao Office: Tech 3.25 Email: Web: Structure: Textbook: yongsheng.gao@griffith.edu.au maxwell.me.gu.edu.au 6 lecturers 1 tutorial 1 laboratory
More informationCprE 281: Digital Logic
CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Signed Numbers CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev Administrative
More informationCombinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.
Combinational Logic ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2017 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Combinational Circuits
More informationTotal Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18
University of Waterloo Department of Electrical & Computer Engineering E&CE 223 Digital Circuits and Systems Midterm Examination Instructor: M. Sachdev October 23rd, 2007 Total Time = 90 Minutes, Total
More informationWhat s the Deal? MULTIPLICATION. Time to multiply
What s the Deal? MULTIPLICATION Time to multiply Multiplying two numbers requires a multiply Luckily, in binary that s just an AND gate! 0*0=0, 0*1=0, 1*0=0, 1*1=1 Generate a bunch of partial products
More informationELEN Electronique numérique
ELEN0040 - Electronique numérique Patricia ROUSSEAUX Année académique 2014-2015 CHAPITRE 3 Combinational Logic Circuits ELEN0040 3-4 1 Combinational Functional Blocks 1.1 Rudimentary Functions 1.2 Functions
More informationCOE 202: Digital Logic Design Combinational Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
COE 202: Digital Logic Design Combinational Circuits Part 4 Dr. Ahmad Almulhem Email: ahmadsm AT kfupm Phone: 860-7554 Office: 22-324 Objectives Magnitude comparator Design of 4-bit magnitude comparator
More information14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?
:33:3 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 3 Lecture #: Binary Number System Complement Number Representation X Y Why Binary Number System? Because
More informationEECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters
EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters April 15, 2010 John Wawrzynek 1 Multiplication a 3 a 2 a 1 a 0 Multiplicand b 3 b 2 b 1 b 0 Multiplier X a 3 b 0 a 2 b 0 a 1 b
More informationCombinational Logic. By : Ali Mustafa
Combinational Logic By : Ali Mustafa Contents Adder Subtractor Multiplier Comparator Decoder Encoder Multiplexer How to Analyze any combinational circuit like this? Analysis Procedure To obtain the output
More informationXI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.
2017-18 XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL HALF ADDER 1. The circuit that performs addition within the Arithmetic and Logic Unit of the CPU are called adders. 2. A unit that adds two
More informationCS61C : Machine Structures
CS 61C L15 Blocks (1) inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks Outline CL Blocks Latches & Flip Flops A Closer Look 2005-07-14 Andy Carle CS
More informationEE 209 Logic Cumulative Exam Name:
EE 209 Logic Cumulative Exam Name: 1.) Answer the following questions as True or False a.) A 4-to-1 multiplexer requires at least 4 select lines: true / false b.) An 8-to-1 mux and no other logi can be
More informationMark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions
Lecture Slides Intro Number Systems Logic Functions EE 0 in Context EE 0 EE 20L Logic Design Fundamentals Logic Design, CAD Tools, Lab tools, Project EE 357 EE 457 Computer Architecture Using the logic
More informationCS61C : Machine Structures
inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #15: Combinational Logic Blocks 2005-07-14 CS 61C L15 Blocks (1) Andy Carle Outline CL Blocks Latches & Flip Flops A Closer Look CS
More informationChapter 5 Arithmetic Circuits
Chapter 5 Arithmetic Circuits SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 11, 2016 Table of Contents 1 Iterative Designs 2 Adders 3 High-Speed
More informationHardware Design I Chap. 4 Representative combinational logic
Hardware Design I Chap. 4 Representative combinational logic E-mail: shimada@is.naist.jp Already optimized circuits There are many optimized circuits which are well used You can reduce your design workload
More informationIntroduction to Digital Logic Missouri S&T University CPE 2210 Subtractors
Introduction to Digital Logic Missouri S&T University CPE 2210 Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu
More informationMultiplication of signed-operands
Multiplication of signed-operands Recall we discussed multiplication of unsigned numbers: Combinatorial array multiplier. Sequential multiplier. Need an approach that works uniformly with unsigned and
More informationWEEK 3.1 MORE ON KARNAUGH MAPS
WEEK 3. MORE ON KARNAUGH MAPS Don t Cares Sometimes, we might have inputs and it doesn t matter what the output is; i.e., we don t care what the output is. These situations are called don t cares. Rather
More informationCOMBINATIONAL LOGIC FUNCTIONS
COMBINATIONAL LOGIC FUNCTIONS Digital logic circuits can be classified as either combinational or sequential circuits. A combinational circuit is one where the output at any time depends only on the present
More informationDesign of Combinational Logic
Pune Vidyarthi Griha s COLLEGE OF ENGINEERING, NASHIK 3. Design of Combinational Logic By Prof. Anand N. Gharu (Assistant Professor) PVGCOE Computer Dept.. 30 th June 2017 CONTENTS :- 1. Code Converter
More information14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation
4:332:23 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 203 Lecture #3: Addition, Subtraction, Multiplication, and Division 2 s-complement Representation RECALL
More informationWORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of
27 WORKBOOK Detailed Eplanations of Try Yourself Questions Electrical Engineering Digital Electronics Number Systems and Codes T : Solution Converting into decimal number system 2 + 3 + 5 + 8 2 + 4 8 +
More informationFunction of Combinational Logic ENT263
Function of Combinational Logic ENT263 Chapter Objectives Distinguish between half-adder and full-adder Use BCD-to-7-segment decoders in display systems Apply multiplexer in data selection Use decoders
More information14:332:231 DIGITAL LOGIC DESIGN
4:332:23 DIGITAL LOGIC DEIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 23 Lecture #4: Adders, ubtracters, and ALUs Vector Binary Adder [Wakerly 4 th Ed., ec. 6., p. 474] ingle
More informationThe Design Procedure. Output Equation Determination - Derive output equations from the state table
The Design Procedure Specification Formulation - Obtain a state diagram or state table State Assignment - Assign binary codes to the states Flip-Flop Input Equation Determination - Select flipflop types
More informationNumber System conversions
Number System conversions Number Systems The system used to count discrete units is called number system. There are four systems of arithmetic which are often used in digital electronics. Decimal Number
More informationNumbers and Arithmetic
Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu
More informationChapter 03: Computer Arithmetic. Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design
Chapter 03: Computer Arithmetic Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design Objective To understand adder circuit Subtractor circuit Fast adder circuit 2 Adder Circuit 3 Full
More informationNumber System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary
Number System Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary BOOLEAN ALGEBRA BOOLEAN LOGIC OPERATIONS Logical AND Logical OR Logical COMPLEMENTATION
More informationCombinational Logic. Course Instructor Mohammed Abdul kader
Combinational Logic Contents: Combinational and Sequential digital circuits. Design Procedure of combinational circuit. Adders: Half adder and Full adder. Subtractors: Half Subtractor and Full Subtractor.
More informationCS61c: Representations of Combinational Logic Circuits
CS61c: Representations of Combinational Logic Circuits J. Wawrzynek March 5, 2003 1 Introduction Recall that synchronous systems are composed of two basic types of circuits, combination logic circuits,
More informationAdders, subtractors comparators, multipliers and other ALU elements
CSE4: Components and Design Techniques for Digital Systems Adders, subtractors comparators, multipliers and other ALU elements Adders 2 Circuit Delay Transistors have instrinsic resistance and capacitance
More informationComputer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Digital Logic
Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 Topic Notes: Digital Logic Our goal for the next few weeks is to paint a a reasonably complete picture of how we can go from transistor
More informationLooking at a two binary digit sum shows what we need to extend addition to multiple binary digits.
A Full Adder The half-adder is extremely useful until you want to add more that one binary digit quantities. The slow way to develop a two binary digit adders would be to make a truth table and reduce
More informationDHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN
DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN UNIT I : BOOLEAN ALGEBRA AND LOGIC GATES PART - A (2 MARKS) Number
More informationAdders, subtractors comparators, multipliers and other ALU elements
CSE4: Components and Design Techniques for Digital Systems Adders, subtractors comparators, multipliers and other ALU elements Instructor: Mohsen Imani UC San Diego Slides from: Prof.Tajana Simunic Rosing
More informationUNIT 4 MINTERM AND MAXTERM EXPANSIONS
UNIT 4 MINTERM AND MAXTERM EXPANSIONS Spring 2 Minterm and Maxterm Expansions 2 Contents Conversion of English sentences to Boolean equations Combinational logic design using a truth table Minterm and
More informationHomework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker
Homework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker Note: + implies OR,. implies AND, ~ implies NOT Question 1: a) (4%) Use transmission gates to design a 3-input OR gate Note: There are
More informationCHAPTER1: Digital Logic Circuits Combination Circuits
CS224: Computer Organization S.KHABET CHAPTER1: Digital Logic Circuits Combination Circuits 1 PRIMITIVE LOGIC GATES Each of our basic operations can be implemented in hardware using a primitive logic gate.
More informationArithmetic Circuits How to add and subtract using combinational logic Setting flags Adding faster
rithmetic Circuits Didn t I learn how to do addition in second grade? UNC courses aren t what they used to be... 01011 +00101 10000 Finally; time to build some serious functional blocks We ll need a lot
More informationArithmetic Circuits-2
Arithmetic Circuits-2 Multipliers Array multipliers Shifters Barrel shifter Logarithmic shifter ECE 261 Krish Chakrabarty 1 Binary Multiplication M-1 X = X i 2 i i=0 Multiplicand N-1 Y = Y i 2 i i=0 Multiplier
More informationChapter 3 Combinational Logic Design
Logic and Computer Design Fundamentals Chapter 3 Combinational Logic Design Part 2 Combinational Logic Charles Kime & Thomas Kaminski 28 Pearson Education, Inc. (Hyperlinks are active in View Show mode)
More informationIT T35 Digital system desigm y - ii /s - iii
UNIT - II Combinational Logic Adders subtractors code converters binary parallel adder decimal adder magnitude comparator encoders decoders multiplexers demultiplexers-binarymultiplier Parity generator
More informationhexadecimal-to-decimal conversion
OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits
More informationNumbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.
Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter 2.4-2.6, 3.2, C.5 C.6 Example: Big Picture Computer System Organization and Programming
More information3. Combinational Circuit Design
CSEE 3827: Fundamentals of Computer Systems, Spring 2 3. Combinational Circuit Design Prof. Martha Kim (martha@cs.columbia.edu) Web: http://www.cs.columbia.edu/~martha/courses/3827/sp/ Outline (H&H 2.8,
More informationCprE 281: Digital Logic
CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Multiplication CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev HW
More informationComputer Architecture. ESE 345 Computer Architecture. Design Process. CA: Design process
Computer Architecture ESE 345 Computer Architecture Design Process 1 The Design Process "To Design Is To Represent" Design activity yields description/representation of an object -- Traditional craftsman
More informationMidterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.
Announcements Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two. Chapter 5 1 Chapter 3: Part 3 Arithmetic Functions Iterative combinational circuits
More informationEE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.
EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions
More informationTime Allowed 3:00 hrs. April, pages
IGITAL ESIGN COEN 32 Prof. r. A. J. Al-Khalili Time Allowed 3: hrs. April, 998 2 pages Answer All uestions No materials are allowed uestion a) esign a half subtractor b) esign a full subtractor c) Using
More information9/29/2016. Task: Checking for a Lower-Case Letter. ECE 120: Introduction to Computing. Change C 5 to C 5 to Obtain L(C) from U(C)
University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 12: Introduction to Computing Multiplexers (Muxes) Task: Checking for a Lower-Case Letter What if we also need
More informationCombinational Logic. Jee-Hwan Ryu. School of Mechanical Engineering Korea University of Technology and Education
MEC5 디지털공학 Combinational Logic Jee-Hwan Ryu School of Mechanical Engineering Combinational circuits Outputs are determined from the present inputs Consist of input/output variables and logic gates inary
More informationCombinational Logic. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C.
Combinational Logic ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall, 2010 ldvan@cs.nctu.edu.tw http://www.cs.nctu.edu.tw/~ldvan/ Combinational Circuits
More informationCOMPUTERS ORGANIZATION 2ND YEAR COMPUTE SCIENCE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHIC-LOGIC UNIT JOSÉ GARCÍA RODRÍGUEZ JOSÉ ANTONIO SERRA PÉREZ
OMUTERS ORGANIZATION 2ND YEAR OMUTE SIENE MANAGEMENT ENGINEERING UNIT 3 - ARITMETHI-LOGI UNIT JOSÉ GARÍA RODRÍGUEZ JOSÉ ANTONIO SERRA ÉREZ Tema 3. La Unidad entral de roceso. A.L.U. Arithmetic Logic Unit
More informationCSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing
CSE4: Components and Design Techniques for Digital Systems Decoders, adders, comparators, multipliers and other ALU elements Tajana Simunic Rosing Mux, Demux Encoder, Decoder 2 Transmission Gate: Mux/Tristate
More informationconvert a two s complement number back into a recognizable magnitude.
1 INTRODUCTION The previous lesson introduced binary and hexadecimal numbers. In this lesson we look at simple arithmetic operations using these number systems. In particular, we examine the problem of
More informationAdders - Subtractors
Adders - Subtractors Lesson Objectives: The objectives of this lesson are to learn about: 1. Half adder circuit. 2. Full adder circuit. 3. Binary parallel adder circuit. 4. Half subtractor circuit. 5.
More informationArithmetic Circuits-2
Arithmetic Circuits-2 Multipliers Array multipliers Shifters Barrel shifter Logarithmic shifter ECE 261 Krish Chakrabarty 1 Binary Multiplication M-1 X = X i 2 i i=0 Multiplicand N-1 Y = Y i 2 i i=0 Multiplier
More informationCs302 Quiz for MID TERM Exam Solved
Question # 1 of 10 ( Start time: 01:30:33 PM ) Total Marks: 1 Caveman used a number system that has distinct shapes: 4 5 6 7 Question # 2 of 10 ( Start time: 01:31:25 PM ) Total Marks: 1 TTL based devices
More informationMODULAR CIRCUITS CHAPTER 7
CHAPTER 7 MODULAR CIRCUITS A modular circuit is a digital circuit that performs a specific function or has certain usage. The modular circuits to be introduced in this chapter are decoders, encoders, multiplexers,
More informationSchedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.
Schedule Date Day Class No. Dec Mon 25 Final Review 2 Dec Tue 3 Dec Wed 26 Final Review Title Chapters HW Due date Lab Due date LAB 8 Exam 4 Dec Thu 5 Dec Fri Recitation HW 6 Dec Sat 7 Dec Sun 8 Dec Mon
More informationDE58/DC58 LOGIC DESIGN DEC 2014
Q.2 a. In a base-5 number system, 3 digit representations is used. Find out (i) Number of distinct quantities that can be represented.(ii) Representation of highest decimal number in base-5. Since, r=5
More informationCIRCUITS AND ELECTRONICS. The Digital Abstraction
6.002 CIRCUITS AND ELECTRONICS The Digital Abstraction Review Discretize matter by agreeing to observe the lumped matter discipline Lumped Circuit Abstraction Analysis tool kit: KVL/KCL, node method, superposition,
More informationA crash course in Digital Logic
crash course in Digital Logic Computer rchitecture 1DT016 distance Fall 2017 http://xyx.se/1dt016/index.php Per Foyer Mail: per.foyer@it.uu.se Per.Foyer@it.uu.se 2017 1 We start from here Gates Flip-flops
More information