How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.

Slides:



Advertisements
Similar presentations
Dr. ClincyLecture1 Appendix A – Part 2: Logic Circuits Current State or output of the device is affected by the previous states Circuit Flip Flops New.
Advertisements

Digital Logic Design Brief introduction to Sequential Circuits and Latches.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Rabie A. Ramadan Lecture 3
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
Sequential Logic Computer Organization II 1 © McQuain A clock is a free-running signal with a cycle time. A clock may be either high or.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Sequential logic circuits First Class 1Dr. AMMAR ABDUL-HAMED KHADER.
SIGNAL TRAINING SCHOOL – BORDER SECIRITY FORCE - TIGRI
Computer Science 210 Computer Organization
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Dr. Clincy Professor of CS
CS161 – Design and Architecture of Computer Systems
Chapter #6: Sequential Logic Design
CS Chapter 3 (3A and ) Part 6 of 8
מבנה מחשב תרגול 3.
Clocks A clock is a free-running signal with a cycle time.
Sequential Logic.
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Synchronous Sequential Circuits
Basics of digital systems
Overview Introduction Logic Gates Flip Flops Registers Counters
CS Chapter 3 (3A and ) – Part 4 of 5
Sequential Logic and Flip Flops
Basics of Digital Logic Design Presentation D
Computer Science 210 Computer Organization
Assistant Prof. Fareena Saqib Florida Institute of Technology
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Latches and Flip-flops
Lecture 3 Boolean Algebra and Digital Logic Lecture Duration: 2 Hours
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Boolean Algebra and Digital Logic
Chapter 4 Gates and Circuits.
Sequential Logic and Flip Flops
CS Fall 2005 – Lec. #5 – Sequential Logic - 1
Boolean Algebra and Digital Logic
Computer Science 210 Computer Organization
触发器 Flip-Flops 刘鹏 浙江大学信息与电子工程学院 March 27, 2018
Instructor: Alexander Stoytchev
Dr. Clincy Professor of CS
CSE 370 – Winter Sequential Logic - 1
Week 7: Gates and Circuits: PART II
Instructor: Alexander Stoytchev
Levels in Processor Design
Instructor: Alexander Stoytchev
Logic Gates.
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Levels in Processor Design
Sequential circuit analysis: kale
Levels in Processor Design
FLIP-FLOPS.
ECE 352 Digital System Fundamentals
Flip-Flops.
Lecture 14: State Tables, Diagrams, Latches, and Flip Flop
Levels in Processor Design
Digital Circuits and Logic
EGR 2131 Unit 12 Synchronous Sequential Circuits
Counters Next, we’ll look at different kinds of counters and discuss how to build them. These are not only examples of sequential analysis and design,
Lecture 4 Sequential units. Registers
Presentation transcript:

How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location at that address The instruction is then “decoded” and executed During execution of each instruction, PC register is incremented by 4 … But *how* does it actually work? … it is a complicated but essential story … CSE 3430; Part 3

Logic gates/circuits At the lowest level, we have electronic circuits … but we won’t go down to that level We will consider level of logic gates/circuits Each logic circuit will have one or more input ports and (typically) one output ports although some have more than one output Before looking at logic gates, let us introduce the underlying math concepts

Boolean logic/algebra Two values: true/false on/off 1/0 We commonly use 1/0 but the others are also very important But most important of all: they all mean the same thing CSE 3430; Part 3

Boolean operations: And, Or, Not A Boolean operator is defined using a truth table AND is like product OR is like sum; but 1+1 is not 2 NOT denoted by overbar or ~ CSE 3430; Part 3

More complex boolean functions Are built out of basic ones: Precedence: NOT then AND then OR So: F(x,y,z) = OR( AND(x,NOT(z)),y) CSE 3430; Part 3

Complex functions as sum of products For each “1” in result column, write corresponding product term; the sum all of the product terms is equal to the function: Can also be written as product of sums: Consider each row with 0 result; it should *not* arise. So for first row, you get the term (x + y + z); for second row, (x + y + z’); for sixth row you get (x’ + y + z’). Product of these three is the result But this is (usually) not the simplest form; can be simplified using various identities

Useful identities/laws These can be verified from the basic definitions (and the precedences of the functions − NOT then AND then OR) Most have an AND form and an OR form CSE 3430; Part 3

Useful identities/laws (contd) CSE 3430; Part 3

Laws can be used to simplify fns Important in practice because it can substantially reduce the cost of circuits but nothing conceptually new. Fact that every boolean function can be written as a sum of products or product of sums (and then simplified) is fundamental CSE 3430; Part 3

Logic Gates The simplest logic gates: AND, OR, NOT CSE 3430; Part 3

Logic Gates (contd) Three other imp. gates: XOR, NAND, NOR NAND, NOR are cheap to make And they are universal: any function can be built using just NAND or just NOR CSE 3430; Part 3

Logic Gates (contd.) NOT, AND, OR using NAND: CSE 3430; Part 3

Logic gates used to implement fns. The main thing to remember: combinations of gates implement Boolean functions. The circuit below implements the Boolean function: Gates may have multiple inputs; & multiple outputs-- especially complement outputs, i.e, Q, ~Q

Logic gates/circuits (contd) Some important principles: The output of a circuit is connected to the input of one or more other circuits … but you cannot connect the output of a circuit to its own input You cannot connect the output of a circuit to that of another Each circuit has a slight delay so that if one or more of its input signals changes, the output will stabilize to its new value after a short delay; most of the time this can be ignored CSE 3430; Part 3

Half adder The following is a “half adder”: It is a half-adder because it doesn’t allow for a “carry-in” although it produces carry-out CSE 3430; Part 3

Two half adders+ for a full adder CSE 3430; Part 3 16 16

Decoders Used, e.g., to select a memory word, given the address Address decoder with n inputs can select any one of 2n words CSE 3430; Part 3

2-to-4 decoder This decoder can be used for a machine with 4-words (!) of memory with 2-bit address: CSE 3430; Part 3

Multiplexor: reverse of a decoder Selects a single output from several inputs. The one chosen determined by the value of the multiplexer’s control lines. To select among n inputs, log2n control lines are needed. CSE 3430; Part 3

4-to-1 multiplexor If S0 = 1 and S1 = 0, which input is transferred to the output? The OR gate at the end can become huge Solution (in some situations): Tri-state devices Data In Data Out Control Control Data In Data Out 0 0 -- 0 1 -- 1 0 0 1 1 1

Combinational vs. sequential circuits A combinational circuit has no “memory”; i.e., the value on its output port(s) depend only on the current values on its input port(s); no dependence on history The value on the output port(s) of a sequential circuit will, in general, depend on the current values on its input port(s) as well as on past values Our circuits so far have been combinational but both kinds are important CSE 3430; Part 3

Basic seq. circuits S R Qa Qb 0/1 1/0 1 (no change) R S Ga Gb Qa Qb R=1, S=1 is not used The SR-gate remembers which of S, R was mostly recently 1 Qb is often denoted as Qa but it is not really complement Suppose R=1 and S=0; then Qa =0 and Qb=1 and they will not change if R becomes 0 If R=0 and S=1; then Qa=1 and Qb=0 and they will not change if S becomes 0 Thus S is “set” and R is “reset” If R and S are both 1 then if both change to 0 (at about the same time), the values of Qa and Qb are unpredictable

Timed sequential circuits clock Clk S R Q(t+1) x Q(t) 1 ?? (no change) Clk S Q R (no change)

Timed sequential circuits Two problems: S, R both being 1 S/R changing when clock signal is 1 C J Q K D Q(t+1) 1 C D Q J K Q(t+1) Q(t) 1 C T Q T Q(t+1) Q(t) 1 In some circuits, there is a circle at the clock input – indicates negative edge triggered

A 4-bit register (using 4 D flip-flops) Current value in the register is always available at the output Values on the input lines appears on the output lines at the next clock cycle More precisely, when there is an input in the second input port, the value that is on the first input port goes into the D flip-flop and is the new value that will appear on the output lines The clock signal can be AND-ed with register address to decide whether this value is intended for this register

4-word, 3-bit memory with addresses 00, 01, 10, 11 on lines S0, S1 “Write Enable” tells us if we want to write a new value into particular word “AND” the address with the clock signal and “Write Enable” and feed it to the “clock port” of each D flip flop of the register. Also use S0,S1 to decide which value appears on Out-lines Tri-state devices used to eliminate the (HUGE) OR gates on the output side

Other imp. gates: XOR, NOR, NAND Summary Boolean functions are described by truth tables. Logic gates implement Boolean operators. The basic gates: AND, OR, and NOT. Other imp. gates: XOR, NOR, NAND NOR, and NAND are universal gates CSE 3430; Part 3

Both combinational circuits & sequential circuits are essential Summary (contd) Both combinational circuits & sequential circuits are essential Combinational circuits produce outputs (almost) immediately when their inputs change. Sequential circuits require clocks to control their changes of state. CSE 3430; Part 3

Summary (contd) Basic sequential circuit: flip-flop Three kinds of flip-flops: JK, D, T Sequential circuits, especially D flip-flops, are the basis of memory But accessing memory requires combinational circuits as well Calculations are done using combinational circuits Ignore remaining slides!

Many basic seq. circuits … D-flip-flop: Output changes only when the value of D changes: this is what is used for implementing memory But remember: the change happens at the next clock cycle; that is what Q(t+1) means CSE 3430; Part 3

Many basic seq. circuits Qa Qb 0/1 1/0 1 R S Ga Gb Qa Qb (no change) Suppose R=1 and S=0; then Qa =0 and Qb=1 and they will not change if R becomes 0 If R=0 and S=1; then Qa=1 and Qb=0 and they will not change if S becomes 0 Thus S is “set” and R is “reset” If R and S are both 1 then if both change to 0 (at about the same time), the values of Qa and Qb are unpredictable CSE 3430; Part 3

Sequential circuits State change occurs in that circuit only when the clock ticks Rising-edge- or falling- edge- or level-triggered … edge triggering is better and more stable … but we will generally not worry about these details Key point: Output of a seq. circuit changes at the next clock cycle