Minimization and Sequential Logic

Slides:



Advertisements
Similar presentations
Digital Circuits.
Advertisements

Latches/Flip-Flops. Overview We focuses on sequential circuits – We add memory to the hardware that we’ve already seen Our schedule will be very similar.
Changes in input values are reflected immediately (subject to the speed of light and electrical delays) on the outputs Each gate has an associated “electrical.
Give qualifications of instructors: DAP
CS 151 Digital Systems Design Lecture 19 Sequential Circuits: Latches.
Classification of Digital Circuits  Combinational. Output depends only on current input values.  Sequential. Output depends on current input values and.
Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital.
1 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
Digital Circuit Review: Combinational Logic Logic operation –Need to know following two input gates: NAND, AND, OR, NOT, XOR –Need to know DeMorgan’s Theorems.
TDC 311 Digital Logic. Truth Tables  AND  OR  NOT  NAND  NOR  XOR  XNOR.
Comparators  A comparator compares two input words.  The following slide shows a simple comparator which takes two inputs, A, and B, each of length 4.
Fall 2007 L16: Memory Elements LECTURE 16: Clocks Sequential circuit design The basic memory element: a latch Flip Flops.
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
EECS 370 Discussion 1 xkcd.com. EECS 370 Discussion Topics Today: – Floating Point – Finite State Machines – Combinational Logic – Sequential Logic 2.
Karnaugh Maps By: Shakil Nobes.
CS1Q Computer Systems Lecture 8
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
Karnaugh Maps Ellen Spertus MCS 111 September 2, 2003.
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.
Chapter5: Synchronous Sequential Logic – Part 1
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.
Sequential Logic Design
Computer Science 210 Computer Organization
Combinational circuits
Pseudo-ops and Bitwise Operations
Combinational circuits
Clocks A clock is a free-running signal with a cycle time.
Morgan Kaufmann Publishers
Bitfields and Logic Basics
COMP541 Sequential Logic – 2: Finite State Machines
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,
Registers and clocking issues
Binary Addition and Subtraction
CS Chapter 3 (3A and ) – Part 4 of 5
Computer Science 210 Computer Organization
Reading: Hambley Chapters
Assistant Prof. Fareena Saqib Florida Institute of Technology
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Digital Logic Design Sequential Circuits (Chapter 6)
Sequential Circuits: Latches
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Chapter 4 Gates and Circuits.
Computer Science 210 Computer Organization
CSE 370 – Winter Sequential Logic - 1
Lecture 15 Logistics Last lecture Today HW4 is due today
Digital Logic.
Sequential Circuits: Latches
Flip-Flops Last time, we saw how latches can be used as memory in a circuit. Latches introduce new problems: We need to know when to enable a latch. We.
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,
Digital Logic.
FSMs, Multiplication, and Division
Arithmetic and Decisions
Latches The second part of CS231 focuses on sequential circuits, where we add memory to the hardware that we’ve already seen. Our schedule will be very.
CS/COE 0447 Jarrett Billingsley
Chapter 10.3 and 10.4: Combinatorial Circuits
Sequential Logic.
ECE 352 Digital System Fundamentals
Flip-Flops.
Basic circuit analysis and design
ECE 352 Digital System Fundamentals
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,
Digital Circuits.
Presentation transcript:

Minimization and Sequential Logic CS/COE 0447 (term 2181) Jarrett Billingsley

Class announcements Things are better!!! Project 2 will be out next week Pushed it back a week anyway since it didn't make sense not to… Here's your exams!!!!!!! I will be calling out letters. Come up when the FIRST LETTER OF YOUR USERNAME is called. Now let's talk about it! 10/24/2017 CS/COE 0447 term 2181

…as I was saying 2 weeks ago, Minimization 10/24/2017 CS/COE 0447 term 2181

Karnaugh Maps (K-maps) – Setting up A Karnaugh Map is a tool for minimizing boolean functions. Let's start with a function that has two inputs. Truth Table K-map Write input values in Gray code along axes. (Here there's only one input on each axis, so it's just 0 1.) Fill in cells from truth table. A B Q 1 1 𝐁 𝐀 1 1 1 1 10/24/2017 CS/COE 0447 term 2181

Karnaugh Maps (K-maps) – Finding rects Find rectangles of 1s with power-of-two width and height. (1, 2, 4, 8…) Overlapping is totally fine! It's good! Use the biggest rectangles possible. Use the fewest rectangles possible. 𝐁 𝐀 1 10/24/2017 CS/COE 0447 term 2181

Karnaugh Maps (K-maps) – Interpreting rects For each rectangle, look at the values of the variables along the axes. Some variables change, and others don't. Which variable changes in the red rectangle? Which doesn't? What about the blue rectangle? Each rectangle is an AND term. Write the variables that stay the same for that rect (keeping the NOT bars). OR all the terms together. WHEW! 𝐁 𝐀 1 Red: 𝐁 Blue: 𝐀 𝐐=𝐀+ 𝐁 10/24/2017 CS/COE 0447 term 2181

One order for the carry-out bit With more than 2 variables, put two along one axis (GRAY CODE!). Ci A B Co 1 Try to make the rectangles as big as possible. Overlap is goooood. 00 01 11 10 Red: 𝐀 𝐂 𝐢 𝐀 𝐁 𝐀 𝐁 𝐀𝐁 Green: 𝐀𝐁 𝐂𝐢 1 Blue: 𝐁 𝐂 𝐢 1 𝐂 𝐨 =𝐀 𝐂 𝐢 +𝐀𝐁+𝐁 𝐂 𝐢 10/24/2017 CS/COE 0447 term 2181

This is really a 2x2 rectangle. It's just… doing its best. Just like a 2D RPG… Rectangles on K-maps can wrap around the edges. 00 01 11 10 𝐗 𝐘 𝐗 𝐘 𝐗𝐘 Red: 𝐘 Blue: 𝐗 𝐙 𝐙 1 𝐐= 𝐘 + 𝐗 𝐙 1 This is really a 2x2 rectangle. It's just… doing its best. 10/24/2017 CS/COE 0447 term 2181

Okay, maybe it's not perfect. Let's try the Sum output of a full adder. A 1x1 rectangle becomes a term that uses all the variables. 00 01 11 10 𝐀 𝐁 𝐀 𝐁 𝐀𝐁 Red: 𝐀𝐁 𝐂 𝐢 Green: 𝐀 𝐁 𝐂 𝐢 𝐂𝐢 1 Blue: 𝐀𝐁 𝐂 𝐢 1 Purple: 𝐀 𝐁 𝐂 𝐢 𝐒𝐮𝐦= 𝐀𝐁 𝐂 𝐢 + 𝐀 𝐁 𝐂 𝐢 +𝐀𝐁 𝐂 𝐢 +𝐀 𝐁 𝐂 𝐢 But wait, didn't we say that we could do it as: 𝐒𝐮𝐦=𝐀⨁𝐁 ⨁𝐂 𝐢 (that's xor!) 10/24/2017 CS/COE 0447 term 2181

Tradeoffs, tradeoffs There are extensions to K-maps to detect XORs. But… XOR gates are slower than AND/OR gates. If area is a concern, an XOR might make sense. If speed is a concern, AND/OR gates make sense. What do real hardware designers do? they use programs to do this stuff for them lol Things like FPGAs, CPLDs, and GALs are reconfigurable hardware which usually use "sum-of-products" to do logic, so ANDs and ORs are all you've got 10/24/2017 CS/COE 0447 term 2181

Sequential Logic 10/24/2017 CS/COE 0447 term 2181

Remember, remember… In combinational logic, the outputs depend on the current inputs. In sequential logic, the outputs depend on the current and previous inputs. That is, sequential logic is able to remember things. What's the smallest bit of information you can remember? A……………. bit. 10/24/2017 CS/COE 0447 term 2181

𝐑 𝐐 𝐒 The SR Latch A B Q 1 𝐐= 𝐑+ (𝐒+ (𝐑+ (𝐒+ (𝐑+ (… Here's a confusing circuit: S stands for set (turn it to 1), and R for reset (turn it to 0). What's the boolean formula for Q? 𝐐= 𝐑+ (𝐒+ (𝐑+ (𝐒+ (𝐑+ (… ????????????????????? This doesn't make sense from a combinatorial view. Let's build it in Logisim. It… works? Notice how it starts off in an error state. 𝐐 𝐑 𝐒 NOR A B Q 1 10/24/2017 CS/COE 0447 term 2181

Why does it work? Because it takes time for electrical signals to move through the wires and through the gates. (What's that called again?) NOR 𝐑 A B Q 1 𝐐 We say this circuit is bistable - it has two (bi) states where its output is stable or steady. It's like a light switch. 𝐒 10/24/2017 CS/COE 0447 term 2181

Which input went to 0 first? But it can break… If we input 1 for both R and S… That's stable. But the problem is when we input 0 on both now. NOR 𝐑 A B Q 1 Which input went to 0 first? 𝐐 If R went to 0 first, then Q = 1. If S went to 0 first, then Q = 0. 𝐒 If they both went to 0 at the exact same time, it will oscillate (flip back and forth)! 10/24/2017 CS/COE 0447 term 2181

These are not great. It would be nice to avoid them. A truth table in time For sequential logic, the next state depends on the previous state. So the previous state becomes another input! Q is our remembered value. How Q changes depends on its current value and the inputs. Qnext says what Q will become. Q S R 1 Qnext 1 ? These are not great. It would be nice to avoid them. 1 1 ? 10/24/2017 CS/COE 0447 term 2181

A better memory cell: the D Latch If we stick some AND gates in front of the SR latch, we get a D(ata) latch. Now we have enable and data inputs. When the enable input is 0… nothing happens. When the enable input is 1… it mirrors Data. When the enable input goes from 1 to 0… It remembers what the Data was! Q E D 1 Qnext 1 1 1 1 10/24/2017 CS/COE 0447 term 2181

Tick tock Sequential logic is based on time, and time is continuous. Trying to build sequential circuits without anything to keep track of time is… possible, but very very difficult. This is why we use a clock signal: it goes 0, 1, 0, 1, 0, 1… rising edge falling edge 1 time We can synchronize our circuits on a clock edge: when it changes between 0 and 1. 10/24/2017 CS/COE 0447 term 2181