(Or Gate) (And Gate) (Not Gate)

Similar documents
Gates, Circuits, and Boolean Algebra

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Logic in Computer Science: Logic Gates

Binary Adders: Half Adders and Full Adders

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Counters and Decoders

CHAPTER 3 Boolean Algebra and Digital Logic

Let s put together a Manual Processor

BINARY CODED DECIMAL: B.C.D.

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Lesson 12 Sequential Circuits: Flip-Flops

Contents COUNTER. Unit III- Counters

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

Lecture 8: Synchronous Digital Systems

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

The components. E3: Digital electronics. Goals:

SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

DEPARTMENT OF INFORMATION TECHNLOGY

ASYNCHRONOUS COUNTERS

CHAPTER 11 LATCHES AND FLIP-FLOPS

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Digital Electronics Detailed Outline

Understanding Logic Design

Two's Complement Adder/Subtractor Lab L03

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

CHAPTER 11: Flip Flops

Memory Elements. Combinational logic cannot remember

Circuits and Boolean Expressions

Chapter 8. Sequential Circuits for Registers and Counters

Counters are sequential circuits which "count" through a specific state sequence.

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Asynchronous Counters. Asynchronous Counters

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Module 3: Floyd, Digital Fundamental

ECE232: Hardware Organization and Design. Part 3: Verilog Tutorial. Basic Verilog

Digital Fundamentals. Lab 8 Asynchronous Counter Applications

Asynchronous counters, except for the first block, work independently from a system clock.

An Extension to DNA Based Fredkin Gate Circuits: Design of Reversible Sequential Circuits using Fredkin Gates

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Lecture #21 April 2, 2004 Relays and Adder/Subtractors

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

Chapter 1: Digital Systems and Binary Numbers

(Refer Slide Time: 00:01:16 min)

Gates, Plexers, Decoders, Registers, Addition and Comparison

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

IE1204 Digital Design F12: Asynchronous Sequential Circuits (Part 1)

Systems I: Computer Organization and Architecture

CS311 Lecture: Sequential Circuits

ECE380 Digital Logic

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

COMBINATIONAL CIRCUITS

Flip-Flops, Registers, Counters, and a Simple Processor

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

Programming A PLC. Standard Instructions

Engr354: Digital Logic Circuits

7. Latches and Flip-Flops

The string of digits in the binary number system represents the quantity

Counters. Present State Next State A B A B

2011, The McGraw-Hill Companies, Inc. Chapter 5

Decimal Number (base 10) Binary Number (base 2)

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Theory of Logic Circuits. Laboratory manual. Exercise 3

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

DM Segment Decoder/Driver/Latch with Constant Current Source Outputs

Lecture-3 MEMORY: Development of Memory:

2 : BISTABLES. In this Chapter, you will find out about bistables which are the fundamental building blocks of electronic counting circuits.

CSE140 Homework #7 - Solution

ECE 3401 Lecture 7. Concurrent Statements & Sequential Statements (Process)

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Modeling Latches and Flip-flops

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

Systems I: Computer Organization and Architecture

Upon completion of unit 1.1, students will be able to

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

DIGITAL-TO-ANALOGUE AND ANALOGUE-TO-DIGITAL CONVERSION

Operating Manual Ver.1.1

Counters & Shift Registers Chapter 8 of R.P Jain

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Seven-Segment LED Displays

Sistemas Digitais I LESI - 2º ano

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

A Digital Timer Implementation using 7 Segment Displays

Lab 1: Full Adder 0.0

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

(1) /30 (2) /30 (3) /40 TOTAL /100

Fundamentals of Digital Electronics

Questions 1. half adder sum. x y

Transcription:

6 March 2015 Today we will be abstracting away the physical representation of logical gates so we can more easily represent more complex circuits. Specifically, we use the shapes themselves to represent what type of gate is being used. (Or Gate) (And Gate) (Not Gate) Let s note that we cannot run two wires together without a gate. We can split a wire to be used as input multiple times. Finally, we will not for the moment allow a gate s output to be reused as input to itself. So, for a more complicated example: p q p q p q p q (p q) (p q) (p q) T T T T F F T F T F T T F T T F T T F F F F T F Using a truth table, we can examine this circuit to recognize that it s output is the XOR of p and q. So let s look at another example, except this time we will start from the proposition instead of the circuit: (x y) x. 1

x y x y x (x y) x 1 1 0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 Notice that, in the truth table above, we were able to save some time by only checking one side of the final And expression; if we get a false, we need not calculate the other value! Binary Expansion Binary is a different way of expressing numbers, which works just like base-10: Proposition 1. Decimal Binary Binary Expansion 0 0 0 2 0 1 1 1 2 0 2 10 0 2 0 + 1 2 1 3 11 1 2 0 + 1 2 1 4 100 0 2 0 + 0 2 1 + 1 2 2 5 101 1 2 0 + 0 2 1 + 1 2 2 6 110 0 2 0 + 1 2 1 + 1 2 2 7 111 1 2 0 + 1 2 1 + 1 2 2 n Z 0, an expression of the form n = a k 2 k + a k 1 2 k 1 + + a 1 2 1 + a 0 2 0 such that a i {0, 1} i. A binary representation of an integer is simply a 0/1 string which lists the coefficients a i in order. Proof. The proof is by induction, and left as an exercise. Long Addition Notice that we need to carry extra digits whenever we add numbers (just as we did in decimal addition): 2

1 0 0 1 0 1 1 0 0 1 So, as we build a circuit to add binary numbers, we will first start with a half-adder: it takes in two inputs (digits), and returns two outputs (the sum and the carry bit). Our table for a half adder may look something like this: x y s c 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 3

9 March 2015 We were attempting to put together a combinatorial circuit for basic addition. Last week, we had just discussed the idea of a half-adder, which has two inputs (a bit from each number), and two outputs (one sum bit and one carry bit). x y x y s c 1 1 0 1 1 0 1 0 0 1 1 0 0 0 0 0 s c Note: the top gate in the above diagram is a Xor gate. But notice that this does not allow us to consider whether a carry bit already existed. So this is what a full adder needs: a third input. x y c in s c out 1 1 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 c in x y s c out If we take these full-adders and black box them into a new, constructed gate, which looks like the following: 4

x y c in c out s Then we can string them together sequentially to make the ripple adder, which adds any two binary numbers. For example, with 5 digits: x 1 y 1 x 2 y 2 x 3 y 3 x 4 y 4 x 5 y 5 0 s 6 s 1 s 2 s 3 s 4 s 5 Because the carry bit ripples across all the 1-bit full adders, this is known as a ripple-adder sometimes. And, because we need to wait for it to ripple across, using this actually slows down addition slightly. By looking for places where both x and y have a 0 bit, we can actually start a new ripple adder at the following point, since we don t need to wait for the carry bit to know it will be a 0. Feedback Before, we did not allow feedback, but now we will allow it! This will allow us to have a concept of state. 5

x θ y x y θ old θ new Action 1 0 1 1 Hold 1 0 0 0 Hold * 1 1 1 Set 1 * 1 0 1 Set 1 0 0 1 1 Set 0 0 0 0 0 Set 0 As you can see, we are able to change and store the value of θ by feeding in certain values to x and y. 6

11 March 2015 We return to feedback circuits! But we re going to move onto a more complex gate called an R-S Latch. R Q S Q Q is the stored value of the circuit. We need to consider that Q already has a value before we give the latch inputs. Consider R = S = 0. If Q started at 0, we get that Q stays at 0. If Q = 1, we still get that Q stays at 1, so R = S = 0 is a hold state. Consider R = 0, S = 1. Because of S = 1, we know that Q will be 0. If we start with Q = 1, then nothing changes; but if Q was 1 before, we will change it to 0, and change Q to 1. Thus, R = 0, S = 1 changes Q to 1. This circuit is symmetric, so we know that R = 1, S = 0 changes Q to 0. If we set both R = 1 and S = 1, then we get that Q = Q = 0, which is a contradiction thus, we never want to set R = 1 and S = 1 simultaneously. Another way of thinking about states like this is with a state diagram, like the following, where each : R = 1, S = 0 S = 0; R = 0, 1 Q = 0 Q = 1 R = 0; S = 0, 1 R = 0, S = 1 Clock Input A clock is an periodically alternating signal that switches between 0 and 1 that flips on some consistent, discrete time scale. Using a clock input we can put together a D-latch, which acts like a safer RS-Latch. A D-latch has two inputs: a clock input C, and an input D. 7

C Q D Q Notice that, by using both D and D in the two And gates, we prevent the possibility of both R and S being 1. Instead, whenever the clock is on, D is written to Q. Manually looking at the RS-latch truth table will confirm this. 8

13 March 2015 Last time, we formed an R/S-latch (2 binary inputs, Q and Q as output) and a D-latch (added clock input). The clock input was an alternating signal that was flipping between 0 and 1 on some time scale. To figure out the output of a D-latch, we have to think about 1) whether the latch is open or closed (ie. the clock is 0 or 1); and 2) what value Q takes on with that input. How do we think about this? We have a stored-value Q. Take D in and record the value of D to Q. Or the value of D comes in but Q does not change, it holds. Open the latch, write the value of D to Q. Close the latch, hold the value of Q until the next time the latch is opened. We can think about an R/S-latch process with state diagrams. We can also think about the subset of a D-latch that comes after the AND gates as an R/S-latch with inputs C D and C D. If C = 0 = S = 0, R = 0 = Q holds. If C = 1, D = 1 = Q 1. Q gets the value of D. If C = 1, D = 0 = Q 0. Q gets the value of D. 9

One limitation of this model is that things can change the entire time that the clock is open. We d like to restrict/know better when things can change. If you know the instant that things are read/written, that s more powerful than just knowing the timeframe during which the change can happen. How do we do this? We re going to box off the D-latch, and use two of them to create a Flip-Flop circuit. (Note: we don t use the first Q in the bigger circuit). Q switches to match D at the moment that C flips from 1 0 this is called a falling edge circuit. Q switches to match D at the moment that C flips from 0 1 this is called a rising edge circuit. The value of D can be fed in at any point up until Q switches. This gives us efficiency in how we use our circuits. 10