Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital.

Slides:



Advertisements
Similar presentations
Combinational Circuits
Advertisements

Chapter 9 Computer Design Basics. 9-2 Datapaths Reminding A digital system (or a simple computer) contains datapath unit and control unit. Datapath: A.
التصميم المنطقي Second Course
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
The Map Method Boolean expressions may be simplified by algebraic means as discussed in Previous lecture However, this procedure of minimization is awkward.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
1 Digital Logic
Lec 17 Nov 2 Chapter 4 – CPU design data path design control logic design single-cycle CPU performance limitations of single cycle CPU multi-cycle CPU.
1 Chapter 4: Arithmetic Where we've been: –Performance (seconds, cycles, instructions) –Abstractions: Instruction Set Architecture Assembly Language and.
Chapter 7 - Part 2 1 CPEN Digital System Design Chapter 7 – Registers and Register Transfers Part 2 – Counters, Register Cells, Buses, & Serial Operations.
1  1998 Morgan Kaufmann Publishers Chapter Four Arithmetic for Computers.
Chapter 3 Arithmetic for Computers. Arithmetic Where we've been: Abstractions: Instruction Set Architecture Assembly Language and Machine Language What's.
Chapter 5 Arithmetic Logic Functions. Page 2 This Chapter..  We will be looking at multi-valued arithmetic and logic functions  Bitwise AND, OR, EXOR,
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Building Functions.
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Floating Point – Finite State Machines – Combinational Logic – Sequential Logic 2.
1 Bits are just bits (no inherent meaning) — conventions define relationship between bits and numbers Binary numbers (base 2)
Introduction to Digital Works. The Digital Works Window.
Combinational Logic Design
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Rabie A. Ramadan Lecture 3
CS1Q Computer Systems Lecture 8
Chapter 6-1 ALU, Adder and Subtractor
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Combinational Design, Part 3: Functional Blocks
CHAPTER 4 Combinational Logic
Lecture 8: Processors, Introduction EEN 312: Processors: Hardware, Software, and Interfacing Department of Electrical and Computer Engineering Spring 2014,
Lecture 14: Processors CS 2011 Fall 2014, Dr. Rozier.
Computing Systems Designing a basic ALU.
Introduction to State Machine
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
ECE 445 – Computer Organization
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
CS 1308 – Computer Literacy and the Internet Building the CPU.
Hamming Code,Decoders and D,T-flip flops Prof. Sin-Min Lee Department of Computer Science.
Logic Design / Processor and Control Units Tony Diep.
1  2004 Morgan Kaufmann Publishers Performance is specific to a particular program/s –Total execution time is a consistent summary of performance For.
1 ELEN 033 Lecture 4 Chapter 4 of Text (COD2E) Chapters 3 and 4 of Goodman and Miller book.
1  2004 Morgan Kaufmann Publishers Lets Build a Processor Almost ready to move into chapter 5 and start building a processor First, let’s review Boolean.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
CPU Overview Computer Organization II 1 February 2009 © McQuain & Ribbens Introduction CPU performance factors – Instruction count n Determined.
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
Chap 5. Registers and Counters
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Computer Arthmetic Chapter Four P&H. Data Representation Why do we not encode numbers as strings of ASCII digits inside computers? What is overflow when.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
1 CPTR 220 Computer Organization Computer Architecture Assembly Programming.
Explain Half Adder and Full Adder with Truth Table.
Logic Design (CE1111 ) Lecture 4 (Chapter 4) Combinational Logic Prepared by Dr. Lamiaa Elshenawy 1.
Addition and multiplication1 Arithmetic is the most basic thing you can do with a computer, but it’s not as easy as you might expect! These next few lectures.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Invitation to Computer Science, C++ Version, Fourth Edition
Prof. Sin-Min Lee Department of Computer Science
Morgan Kaufmann Publishers
Invitation to Computer Science, Java Version, Third Edition
FUNCTION OF COMBINATIONAL LOGIC CIRCUIT
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
5. Combinational circuits
CSE 370 – Winter Sequential Logic-2 - 1
Combinational Circuits
Digital Circuits and Logic
Presentation transcript:

Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital Works intro PH 3 : Appendix B.6-9

Chapter 1 — Computer Abstractions and Technology — 2 Adders Last time we developed a 32 bit ripple adder. It is not an efficient adder, although simple to understand, so how can we improve its performance. We will try to see what can be done to speed it up.

— 3 Is a 32-bit ALU as fast as a 1-bit ALU? Is there more than one way to do addition? two extremes: ripple carry and sum-of-products Can you see the ripple? How could you get rid of it? c 1 = b 0 c 0 + a 0 c 0 + a 0 b 0 c 1 = (b 0 + a 0 )c 0 + a 0 b 0 c 2 = b 1 c 1 + a 1 c 1 + a 1 b 1 c 2 = (b 1 + a 1 )c 1 + a 1 b 1 c 3 = b 2 c 2 + a 2 c 2 + a 2 b 2 c 3 = … c 4 = b 3 c 3 + a 3 c 3 + a 3 b 3 c 4 = … Problem: ripple carry adder is slow

— 4 An approach in-between our two extremes Motivation: If we didn't know the value of carry-in, what could we do? Let g i = a i b i, called generate, and, p i = a i + b i, called propagate. Now the equations can be written as below c 1 = g 0 + p 0 c 0 c 2 = g 1 + p 1 c 1 = g 1 + p 1 (g 0 + p 0 c 0 ) c 3 = g 2 + p 2 c 2 = g 2 + p 2 (g 1 + p 1 (g 0 + p 0 c 0 )) c 4 = g 3 + p 3 c 3 =... So we see it is possible to generate however many carries we desire that are independent of all carries except c 0. However it tends to become quite expensive in terms of numbers of gates. So what can we do? Carry-lookahead adder

Chapter 1 — Computer Abstractions and Technology — 5 A four bit carry lookahead adder

Chapter 1 — Computer Abstractions and Technology — 6 Cascade connection of 4-bit carry lookahead adders. Can’t build a 16 bit adder this way... (too big) Could use ripple carry of 4-bit CLA adders Better: use the CLA principle again!

Chapter 1 — Computer Abstractions and Technology — 7 Memory Simple Flip-Flop Applications

Chapter 1 — Computer Abstractions and Technology — 8 Basic bistable element.

Chapter 1 — Computer Abstractions and Technology — 9 SR (set-reset) latch. (a) Logic diagrams. (b) Function table where Q + denotes the output Q in response to the inputs. (c) Two logic symbols.

Chapter 1 — Computer Abstractions and Technology — 10 An application of the SR latch. (a) Effects of contact bounce. (b) A switch debouncer.

Chapter 1 — Computer Abstractions and Technology — 11 latch. (a) Logic diagrams. (b) Function table where Q + denotes the output Q in response to the inputs. (c) Two logic symbols.

Chapter 1 — Computer Abstractions and Technology — 12 Gated SR latch. (a) Logic diagram. (b) Function table where Q + denotes the output Q in response to the inputs. (c) Two logic symbols (c)(c)

Chapter 1 — Computer Abstractions and Technology — 13 Gated D latch. (a) Logic diagram. (b) Function table where Q + denotes the output Q in response to the inputs. (c) Two logic symbols.

Chapter 1 — Computer Abstractions and Technology — 14 Timing diagram for an SR latch.

Chapter 1 — Computer Abstractions and Technology — 15 Timing diagram for a gated D latch.

Chapter 1 — Computer Abstractions and Technology — 16 Positive-edge-triggered D flip-flop. (a) Logic diagram. (b) Function table where Q + denotes the output Q in response to the inputs. (c) Two logic symbols.

Chapter 1 — Computer Abstractions and Technology — 17 Positive-edge-triggered D flip-flop NAND gates 5 and 6 serve as an latch. Thus as long as S = R = 0, i.e. S’ = R’ = 1, the state of the latch cannot change; while whenever S or R is 1, i.e. S’ or R’ is 0, but not both the latch sets or resets. Now if C = 0 the outputs of gates 2 and 3 are 1, regardless of D, so the latch does not change. Now assume D = 0. then the output at gate 4 is 1 and at gate 1 is 0 since the outputs at gates 4 and 2 are 1. When C goes from 0 to 1, the positive edge, all inputs to gate 3 become 1 so R’ = 0. But S’ remains 1 since the input from gate 1 is still 0 so Q = 0 and Q’ = 1. In addition the ouput 0 from gate 3 feeds back to gate 4 to keep the output there at 1 regardless of changes to D so long as C stays equal 1.

Chapter 1 — Computer Abstractions and Technology — 18 Positive-edge-triggered flip-flop continued Now suppose C = 0 and D = 1. As before the ouputs from gates 2 and 3 are 1 causing the S’R’ latch to hold its current state. However D = 1 causes the output of gate 4 to be 0 which causes the output of gate 1 to be 1. Now when C changes to 1 both inputs to gate 2 become 1 so S’ = 0. R’ remains 1 since the input from gate 4 to gate 3 is 0. Now S’ = 0 and R’ = 1 causes Q = 1 and Q’ = 0. The 0 output from gate 2 causes the outputs at gates 1 and 3 to remain at 1. Thus if D changes as long as C = 1, there will be no change in the S’R’ latch.

Chapter 1 — Computer Abstractions and Technology — 19 Timing diagram for a positive-edge-triggered D flip-flop.

Chapter 1 — Computer Abstractions and Technology — 20 General model of a sequential network.

Chapter 1 — Computer Abstractions and Technology — 21 Logic Design Basics Information encoded in binary Low voltage = 0, High voltage = 1 One wire per bit Multi-bit data encoded on multi-wire buses Combinational element Operate on data Output is a function of input State (sequential) elements Store information

Chapter 1 — Computer Abstractions and Technology — 22 Combinational Elements AND-gate Y = A & B A B Y I0 I1 Y MuxMux S Multiplexer Y = S ? I1 : I0 A B Y + A B Y ALU F Adder Y = A + B Arithmetic/Logic Unit Y = F(A, B)

Chapter 1 — Computer Abstractions and Technology — 23 Structure of a clocked synchronous sequential network.

Chapter 1 — Computer Abstractions and Technology — 24 An m-bit register using D flip-flops

Chapter 1 — Computer Abstractions and Technology — 25 Register File: Built using flip-flops

Chapter 1 — Computer Abstractions and Technology — 26 Universal shift register. (a) Logic diagram. (b) Mode control. (c) Symbol.

— 27 Do you understand? What is the “Mux”?

Chapter 1 — Computer Abstractions and Technology — 28 Multiplexor A multiplexor that chooses one of two words. Built by using 1 bit multiplexors and stringing them together as on the right.

Chapter 1 — Computer Abstractions and Technology — 29 An n-to-2 n -line decoder symbol.

Chapter 1 — Computer Abstractions and Technology — 30 A 3-to-8-line decoder. (a) Logic diagram. (b) Truth table. (c) Symbol.

— 31 Register File (Note: we still use the real clock to determine when to write)

— 32 Simple Implementation The functional units we need for each instruction

Chapter 1 — Computer Abstractions and Technology — 33 Simple implementation continued. Functions needed for loads and stores

Chapter 1 — Computer Abstractions and Technology — 34 Simple implementation continued. What happens to the instruction

Chapter 1 — Computer Abstractions and Technology — 35 Introduction to Digital Works

Chapter 1 — Computer Abstractions and Technology — 36 The Digital Works Window

Chapter 1 — Computer Abstractions and Technology — 37 Creating and using Macros Converting the two-input multiplexer circuit into a black box

Chapter 1 — Computer Abstractions and Technology — 38 Creating the black box Left click on the arrow. Right click on one of the macro tags. Select Template Editor from the menu with a left click. The Template Editor window appears. You can create a symbol for your circuit. There may already be a default black box and if there is you can use it if you like, or you can delete it and draw one that you like.

Chapter 1 — Computer Abstractions and Technology — 39 Creating a symbol for the new circuit

Chapter 1 — Computer Abstractions and Technology — 40 Procedure for building the macro Once you have drawn an object or decided to use the default one you select the Pin Icon by left clicking. You then place the cursor where you want it to be in the diagram and left click to insert it. Next select it and right click and select associate with tag from the menu. Next close the template editor. You will notice a 1 next to the selected macro tag. Now select another macro tag, right click and select template editor and repeat the above procedure except for drawing the template. Do this for the remaining macro tags and then save the file. You do not use a separate name for the macro.

Chapter 1 — Computer Abstractions and Technology — 41 Creating an interface point in the black box

Chapter 1 — Computer Abstractions and Technology — 42 The completed black box representation

Chapter 1 — Computer Abstractions and Technology — 43 The original circuit with the macro tags numbered

Chapter 1 — Computer Abstractions and Technology — 44 Using a Macro Embedding a macro in a circuit

Chapter 1 — Computer Abstractions and Technology — 45 Using a Macro continued You can use the push button interactive tool to insert inputs to the macro and the LED tool to insert outputs to the macro. You then wire the interactive buttons and LEDs to the appropriate macro icons. You can then run and test it. Suppose you want to build a circuit having more than one macro (which may or may not be the same) Select the embed macro button and position the cursor to where you want it in the workspace and left click.

Chapter 1 — Computer Abstractions and Technology — 46 Embedding two macros, wiring them together

Chapter 1 — Computer Abstractions and Technology — 47 Editing a macro in a circuit

Chapter 1 — Computer Abstractions and Technology — 48 Editing the expanded form of the macro

Chapter 1 — Computer Abstractions and Technology — 49

Chapter 1 — Computer Abstractions and Technology — 50

Chapter 1 — Computer Abstractions and Technology — 51 Decimal Codes Decimal 8421 Excess-3 digit code code

Chapter 1 — Computer Abstractions and Technology — 52 Building a BCD adder Adding two single decimal digits given in 8421 BCD code can be accomplished by adding the 8421 representations as binary numbers. If there is no carry then the sum digit is exactly the binary sum and represents the 8421 representation of the two decimal digits. If there is a carry then this carry bit corresponds to 16 decimal and thus the correct two digit decimal number can be determined by subtracting 6 from the 5 th bit making it a 10 and adding the 6 into the first digit which is represented by the rightmost 4 digits. For example a sum of 18, given as = If we count the leading 1 as the tens digit then we must add to get = 18, i.e. 16 – 6 = 10 and = Now the = as a 8421 BCD 2 digit number.

Chapter 1 — Computer Abstractions and Technology — 53 Organization of a single-decade 8421 BCDdecimal adder.

Chapter 1 — Computer Abstractions and Technology — 54 Organization of a single-decade 8421 BCD adder.

Chapter 1 — Computer Abstractions and Technology — 55 Karnaugh map to detect the combinations P3P2P1P0 = 1010, 1011,..., P 3 P 2 + P 3 P 1 true implies one of the above combinations

Chapter 1 — Computer Abstractions and Technology — 56 A single-decade 8421 BCD adder.

Chapter 1 — Computer Abstractions and Technology — 57 Reading for next time PH 3: Chapter 5, sections