Arithme(c logic units and memory

Similar documents
Design of Sequential Circuits

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

CprE 281: Digital Logic

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

Sequential Circuits Sequential circuits combinational circuits state gate delay

ELEN Electronique numérique

Combina-onal Logic Chapter 4. Topics. Combina-on Circuit 10/13/10. EECE 256 Dr. Sidney Fels Steven Oldridge

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CS61C : Machine Structures

Latches. October 13, 2003 Latches 1

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

UNIT 8A Computer Circuitry: Layers of Abstraction. Boolean Logic & Truth Tables

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

Review for Final Exam

CS61C : Machine Structures

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

Unit 7 Sequential Circuits (Flip Flop, Registers)

Lecture 17: Designing Sequential Systems Using Flip Flops

EECS150 - Digital Design Lecture 23 - FFs revisited, FIFOs, ECCs, LSFRs. Cross-coupled NOR gates

ELCT201: DIGITAL LOGIC DESIGN

Adders, subtractors comparators, multipliers and other ALU elements

Sequential Circuit Analysis

UNIVERSITY OF WISCONSIN MADISON

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Adders, subtractors comparators, multipliers and other ALU elements

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

CMP 334: Seventh Class

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Menu. Excitation Tables (Bonus Slide) EEL3701 EEL3701. Registers, RALU, Asynch, Synch

Gates and Flip-Flops

Lecture 7: Logic design. Combinational logic circuits

DE58/DC58 LOGIC DESIGN DEC 2014

ALU A functional unit

Sequential Logic Circuits

Chapter 5 Synchronous Sequential Logic

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

Adders allow computers to add numbers 2-bit ripple-carry adder

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Circuits & Boolean algebra.

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

I. Motivation & Examples

Philadelphia University Student Name: Student Number:

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Digital Circuits. 1. Inputs & Outputs are quantized at two levels. 2. Binary arithmetic, only digits are 0 & 1. Position indicates power of 2.

CPE100: Digital Logic Design I

Roger L. Tokheim. Chapter 8 Counters Glencoe/McGraw-Hill

Digital Logic Appendix A

Combinatorial Logic Design Multiplexers and ALUs CS 64: Computer Organization and Design Logic Lecture #13

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Digital Electronic Meters

Homework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker

Chapter 7 Sequential Logic

ELCT201: DIGITAL LOGIC DESIGN

Synchronous Sequential Logic

Chapter 4. Sequential Logic Circuits

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

CSCI 2150 Intro to State Machines

Sequential Logic Worksheet

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Boolean Algebra. Digital Logic Appendix A. Postulates, Identities in Boolean Algebra How can I manipulate expressions?

Topic 8: Sequential Circuits

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Chapter 14 Sequential logic, Latches and Flip-Flops

Sequential vs. Combinational

CSE370 HW6 Solutions (Winter 2010)

EE 209 Logic Cumulative Exam Name:

PG - TRB UNIT-X- DIGITAL ELECTRONICS. POLYTECHNIC-TRB MATERIALS

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Boolean Algebra. Digital Logic Appendix A. Boolean Algebra Other operations. Boolean Algebra. Postulates, Identities in Boolean Algebra

Show that the dual of the exclusive-or is equal to its compliment. 7

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

LECTURE 28. Analyzing digital computation at a very low level! The Latch Pipelined Datapath Control Signals Concept of State

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

DIGITAL LOGIC CIRCUITS

Lecture 9: Digital Electronics

Digital Electronics II Mike Brookes Please pick up: Notes from the front desk

CS/COE0447: Computer Organization

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Schedule. 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.

Counters. We ll look at different kinds of counters and discuss how to build them

ESE 570: Digital Integrated Circuits and VLSI Fundamentals

Logic Design II (17.342) Spring Lecture Outline

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

Logic BIST. Sungho Kang Yonsei University

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

Philadelphia University Faculty of Engineering

Lecture 13: Sequential Circuits, FSM

Decoding A Counter. svbitec.wordpress.com 1

Lecture 13: Sequential Circuits, FSM

Review Problem 1. should be on. door state, false if light should be on when a door is open. v Describe when the dome/interior light of the car

Lecture 10: Synchronous Sequential Circuits Design

Digital Logic Design - Chapter 4

Sequential Circuit Design

Transcription:

Arithme(c logic units and memory CSCI 255: Introduc/on to Embedded Systems Keith Vertanen Copyright 2011

Layers of abstrac-on abstrac(on building blocks examples computer components Macbook Pro components sequen-al circuits mul(plexer, demul(plexer, adder, flip- flop logic gates, connectors, clock registers, ALU, counter flip- flop combina-onal circuit logic gates, connectors mul-plexer, demul-plexer, adder logic gates switches, connectors AND, OR, NOT clock raw materials crystal oscillator connector raw materials Wire switch raw materials transistor, relay 2

ALU ALU (Arithme-c Logic Unit) Building block of the CPU Normally at least: Bitwise AND, NOT, OR, XOR Integer addi-on, subtrac-on Bit shioing Input from memory register(s) Output to memory register Which opera-on stored determined by signal from control unit 3

Let's build an ALU ALU (Arithme-c Logic Unit) 4 different opera-ons Add, subtract, bitwise AND, bitwise XOR Two 4- bit inputs One 4- bit output ALU performs all 4 opera-ons in parallel 2 selec-on bits select result put on output wires 4

4- bit full adder Goal: x + y = z for 4- bit integers c 0 x 3 x 2 x 1 x 0 + y 3 y 2 y 1 y 0 c 4 z 3 z 2 z 1 z 0 c 4 MAJ MAJ MAJ MAJ x 3 y 3 x 2 y 2 x 1 y 1 x 0 y 0 c 0 ODD ODD ODD ODD z 3 z 2 z 1 z 0 5

4- bit adder c 0 x 3 x 2 x 1 x 0 + y 3 y 2 y 1 y 0 c 4 z 3 z 2 z 1 z 0 4- bit input x 4- bit input y ADD carry in 4- bit output z 6

4- bit subtractor Goal: x - y = z for 4- bit integers One approach: design like adder circuit Be]er approach: reuse the adder Two's complement, invert bits and add 1 4- bit input x 4- bit input y ADD 4- bit output z 4- bit input y 4- bit input x ADD 4- bit output z 0 1 Circuit doing addi-on Circuit doing subtrac-on 7

Bitwise AND, XOR 4- bit input x 4- bit input y AND 4- bit output z 4- bit input x 4- bit input y XOR 4- bit output z 8

ADD 0 ALU parts 4 to 1 MUX 4 to 1 MUX ADD 1 4 to 1 MUX 4 to 1 MUX AND XOR 9

ALU with 4- bit lines 10

Our simple ALU First input Output of calcula-on 2 bits on this line Second input 4 bits on these lines Business end of the ALU, compute all opera-ons in parallel Which type of thing to output, 00 = ADD, 01 = SUB, 10 = AND, 11 = XOR 11

n- bit register Let's build a register Group of n flip- flops storing n bits Includes combina-onal gates Provides output of its n stored bits Can be told to memorize n bits on input lines Someone sets load line high 12

D flip- flop Clocked D flip- flop Hook the enable line to a clock Clocked latch = flip- flop State change has to wait for next clock cycle D C Q D (data) C (clock) Q(t) Q(t+1) 0 high x 0 1 high x 1 13

4- bit register with parallel load 14

Set to high to memorize input bits 4- bit register with parallel load Input bits Logic to keep value the same except if load is high Flip- flops Output bits 15

Let's build a register bank We need to store mul-ple variables Use four 4- bit registers Someone sets target register number 0-3 Put target register's stored value on output line If write bit enabled, make target register memorize data on input line 16

Four 4- bit register bank 17

Four 4- bit register bank Value to write Four 4- bit parallel load registers Write new value? Output of bank Select which register will get enabled if write is high Select output from one of the registers Which register to write to or read from 18

Let's build a computer (sort of) So far we've built: ALU Computes 4 opera-ons on two 4- bit numbers Register bank Select one of four 4- bit numbers Let's hook them together! Problem: ALU needs two inputs and one output 19

Mul-port register bank Original design of register bank New design, can write to one address while reading from two different addresses 20

Mul-port register bank Which register to send to output 1 Which register to write input 1 to (if write is high) Which register to send to output 2 21

Hello computer 22

Hello computer Mul-port register bank Simple ALIU 23

Let s build a counter 4- bit synchronous counter Count from 0000 up to 1111 Roll back to 0 Increment on each clock cycle Working on an algorithm Which bit always flips? When do other bits flip? Counter 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 24

Let s build a counter 4- bit synchronous counter Count from 0000 up to 1111 Roll back to 0 Increment on each clock cycle Working on an algorithm Which bit always flips? Least significant bit always flips When do other bits flip? Other bits flip when all bits to right are 1 Counter 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 25

JK flip- flop JK flip- flop Refinement of SR flip- flop SET: J=1, K=0 RESET: J=0, K=1 TOGGLE: J=1, K=1 (flips the stored bit) J K C (clock) Q(t) Q(t+1) 0 0 high x x 0 1 high x 0 1 0 high x 1 1 1 high x x J C K Q 26

T flip- flop toggle T flip- flop Like JK but connect J and K together LEAVE: T=0 TOGGLE: T=1 (flips the stored bit) T C (clock) Q(t) Q(t+1) 0 high x x 1 high x x T C Q 27

4- bit synchronous counter 28

4- bit synchronous counter 4 T flip- flops plus logic so they only toggle if all less significant bits are 1 4- bit output of counter 29

Summary Built a simple ALU Used flip- flops to build a register Created a register bank Created a mul-ported register bank Made a simple computer Made a counter 30