CprE 281: Digital Logic

Similar documents
CprE 281: Digital Logic

Design of Sequential Circuits

CprE 281: Digital Logic

ECE 341. Lecture # 3

Combinational Logic. By : Ali Mustafa

CprE 281: Digital Logic

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

ALU A functional unit

Design at the Register Transfer Level

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

CprE 281: Digital Logic

Chapter 5. Digital Design and Computer Architecture, 2 nd Edition. David Money Harris and Sarah L. Harris. Chapter 5 <1>

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

Digital Logic. CS211 Computer Architecture. l Topics. l Transistors (Design & Types) l Logic Gates. l Combinational Circuits.

CprE 281: Digital Logic

ECE 250 / CPS 250 Computer Architecture. Basics of Logic Design Boolean Algebra, Logic Gates

Arithme(c logic units and memory

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

Sample Test Paper - I

CSE140: Components and Design Techniques for Digital Systems. Decoders, adders, comparators, multipliers and other ALU elements. Tajana Simunic Rosing

ECE/CS 250 Computer Architecture

Combinational Logic. Mantıksal Tasarım BBM231. section instructor: Ufuk Çelikcan

Logic and Computer Design Fundamentals. Chapter 8 Sequencing and Control

CprE 281: Digital Logic

Logic. Combinational. inputs. outputs. the result. system can

ELCT201: DIGITAL LOGIC DESIGN

Lecture 7: Logic design. Combinational logic circuits

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

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Lecture 13: Sequential Circuits, FSM

Preparation of Examination Questions and Exercises: Solutions

Boolean Logic Continued Prof. James L. Frankel Harvard University

課程名稱 : 數位邏輯設計 P-1/ /6/11

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

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

COMBINATIONAL LOGIC FUNCTIONS

CS61C : Machine Structures

Fundamentals of Digital Design

ELEN Electronique numérique

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

DE58/DC58 LOGIC DESIGN DEC 2014

CS61C : Machine Structures

Adders, subtractors comparators, multipliers and other ALU elements

Sequential Circuits. CS/EE 3700 : Fundamentals of Digital System Design

VHDL DESIGN AND IMPLEMENTATION OF C.P.U BY REVERSIBLE LOGIC GATES

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

Adders, subtractors comparators, multipliers and other ALU elements

Section 3: Combinational Logic Design. Department of Electrical Engineering, University of Waterloo. Combinational Logic

Fundamentals of Computer Systems

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

Latches. October 13, 2003 Latches 1

Review for Final Exam

UNIVERSITY OF WISCONSIN MADISON

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

CMP 334: Seventh Class

Logic. Basic Logic Functions. Switches in series (AND) Truth Tables. Switches in Parallel (OR) Alternative view for OR

Figure 4.9 MARIE s Datapath

Binary addition example worked out

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS

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

BER KELEY D AV IS IR VINE LOS AN GELES RIVERS IDE SAN D IEGO S AN FRANCISCO

INF2270 Spring Philipp Häfliger. Lecture 8: Superscalar CPUs, Course Summary/Repetition (1/2)

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

Systems I: Computer Organization and Architecture

CPE100: Digital Logic Design I

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

Introduction to Computer Engineering. CS/ECE 252, Fall 2012 Prof. Guri Sohi Computer Sciences Department University of Wisconsin Madison

Digital Integrated Circuits A Design Perspective. Arithmetic Circuits. Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolic.

CMPE12 - Notes chapter 2. Digital Logic. (Textbook Chapters and 2.1)"

Combinational Logic Design Combinational Functions and Circuits

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Verilog HDL:Digital Design and Modeling. Chapter 11. Additional Design Examples. Additional Figures

Chapter 5 Arithmetic Circuits

Logic Design II (17.342) Spring Lecture Outline

Chapter 3 Digital Logic Structures

Fundamentals of Computer Systems

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

SRC Language Conventions. Class 6: Intro to SRC Simulator Register Transfers and Logic Circuits. SRC Simulator Demo. cond_br.asm.

CSC 322: Computer Organization Lab

Topic 8: Sequential Circuits

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

ECE 2300 Digital Logic & Computer Organization

Spiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller

Digital Logic Appendix A

CMPEN 411 VLSI Digital Circuits Spring Lecture 19: Adder Design

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

Combinational Logic Trainer Lab Manual

Digital Integrated Circuits A Design Perspective. Arithmetic Circuits. Jan M. Rabaey Anantha Chandrakasan Borivoje Nikolic.

CMSC 313 Lecture 25 Registers Memory Organization DRAM

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Number Systems 1(Solutions for Vol 1_Classroom Practice Questions)

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

Table of Content. Chapter 11 Dedicated Microprocessors Page 1 of 25

Floating Point Representation and Digital Logic. Lecture 11 CS301

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

Transcription:

CprE 28: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/

Simple Processor CprE 28: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev

Digital System Datapath circuit To store data To manipulate data To transfer data from one part of the system to another Comprise building blocks such as registers, shift registers, counters, multipliers, decoders, encoders, adders, etc. Control circuit Controls the operation of the datapath circuit Designed as a FSM

A Simple Processor [ Figure 7.9 from the textbook ]

What are the components? [ Figure 7.9 from the textbook ]

Registers [ Figure 7.9 from the textbook ]

Data Bus [ Figure 7.9 from the textbook ]

Tri-State Drivers [ Figure 7.9 from the textbook ]

Arithmetic Logic Unit (ALU) [ Figure 7.9 from the textbook ]

Control Circuit [ Figure 7.9 from the textbook ]

A Closer Look at the Registers

Register R0 [ Figure 7.9 from the textbook ]

All Registers [ Figure 7.9 from the textbook ]

Registers R0, R, R2 and R3 are accessible to the programmer [ Figure 7.9 from the textbook ]

Registers A and G are NOT accessible to the programmer [ Figure 7.9 from the textbook ]

4-Bit Register

Loading Data into the Register 0 0

Loading Data into the Register 0 0

Loading Data into the Register 0 0

Loading Data into the Register 0 0 0 0

Keeping Data into the Register 0 0

Keeping Data into the Register 0 0 0

Keeping Data into the Register 0 0 0

A Closer Look at the Data Bus

Data Bus [ Figure 7.9 from the textbook ]

Bus Structure We need a way to transfer data from any register (device) to any other register (device) A bus is simply a set of n wires to transfer n-bit data n Bus What if two registers write to the bus at the same time?

One way to implement a data bus is to use multiplexers [ Figure 7.4 from the textbook ]

One way to implement a data bus is to use multiplexers (four 5-to- multiplexers) This requires one multiplexer per bit. Assuming there are four 4-bit registers, we need four 5-to- multiplexers. [ Figure 7.4 from the textbook ]

One way to implement a data bus is to use multiplexers The reason we need 5-to- is because the external data counts as an "extra register". (four 5-to- multiplexers) [ Figure 7.4 from the textbook ]

A Closer Look at the Tri-State Driver

Tri-State Driver [ Figure 7.9 from the textbook ]

All Tri-State Drivers [ Figure 7.9 from the textbook ]

Tri-state driver (see Appendix B for more details) Z: High impedance state [ Figure 7. from the textbook ]

Tri-state driver (see Appendix B for more details) Alternative way to implement a data bus Allows several devices to be connected to a single wire (this is not possible with regular logic gates because their outputs are always active; an OR gate is needed) Note that at any time, at most one of e0, e, e2, and e3 can be set to device3 device2 device device0 e3 e2 e e0

An n-bit Tri-State Driver can be constructed using n -bit tri-state buffers Input e e e e e Output

2-Bit Register IN OUT IN 0 OUT 0 0 0 R in Clock

How to connect two 2-bit registers to a bus (using tri-state drivers) This shows only two 2-bit registers, but this design scales to more and larger registers. [ Figure 7.3 from the textbook ]

Moving the Contents of R to R2 0 0 Register stores the number 2 0 = 0 2 Register 2 stores the number 0 = 0 2

Moving the Contents of R to R2 0 0 0 0 0 0 Initially all control inputs are set to 0 (no reading or writing allowed).

Moving the Contents of R to R2 0 0 0 0 0 R out is set to (this enables reading from register ).

Moving the Contents of R to R2 0 0 0 0 0 The bits of R are now on the data bus (2-bit data bus in this case).

Moving the Contents of R to R2 0 0 0 0 R2 in is set to (this enables writing to register 2).

Moving the Contents of R to R2 0 0 0 0 The bits of R are still on the bus and they propagate to the multiplexers...

Moving the Contents of R to R2 0 0 0 0... and on the next positive clock edge to the outputs of the flip-flops of R2.

Moving the Contents of R to R2 0 0 0 0 0 0 After the copy is complete R out and R2 in are set to 0.

Moving the Contents of R to R2 0 0 0 0 0 0 All control inputs are now disabled (no reading or writing is allowed).

Moving the Contents of R to R2 0 0 0 0 0 0 Register 2 now holds the same value as register.

Another Example

Loading Data From The Bus Into R2 0 0 0 0 0 0 Initially all control inputs are set to 0 (no reading or writing allowed).

Loading Data From The Bus Into R2 0 0 0 0 0 0 The number 3 0 = 2 is placed on the 2-bit data bus.

Loading Data From The Bus Into R2 0 0 0 0 0 R2 in is set to (this enables writing to register 2).

Loading Data From The Bus Into R2 0 0 0 0 0 The bits of the data propagate the the multiplexers...

Loading Data From The Bus Into R2 0 0 0 0... and on the next positive clock edge to the outputs of the flip-flops of R2.

Loading Data From The Bus Into R2 0 0 0 0 0 After the loading is complete R2 in is set to 0.

Loading Data From The Bus Into R2 0 0 0 0 0 Register 2 now stores the number 3 0 = 2.

A Closer Look at the Arithmetic Logic Unit (ALU)

Arithmetic Logic Unit (ALU) [ Figure 7.9 from the textbook ]

Two Registers [ Figure 7.9 from the textbook ]

4-Bit Register

Adder/Subtractor [ Figure 7.9 from the textbook ]

Adder/Subtractor unit y n y y 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

The first two stages of a carry-lookahead adder x y x 0 y 0 x 0 y 0 g p g 0 p 0 c 0 c 2 c s s 0 [ Figure 3.5 from the textbook ]

A hierarchical carry-lookahead adder x 3 24 y 3 24 x 5 8 y 5 8 x 7 0 y 7 0 Block 3 c 24 Block Block 0 c 0 G 3 P 3 G P G 0 P 0 s 3 24 s 5 8 s 7 0 c 32 c 6 c 8 Second-level lookahead [ Figure 3.7 from the textbook ]

Adder/subtractor unit Subtraction can be performed by simply adding the 2 s complement of the second number, regardless of the signs of the two numbers. Thus, the same adder circuit can be used to perform both addition and subtraction!!!

Adder/subtractor unit y n y y 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

XOR Tricks control out y

XOR as a repeater 0 y y

XOR as an inverter y y

Addition: when control = 0 y n y y 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Addition: when control = 0 y n 0 y 0 y 0 0 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Addition: when control = 0 y n 0 y 0 y 0 0 0 Add Sub control x n x x 0 c n n -bit adder y n- y y 0 c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Subtraction: when control = y n y y 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Subtraction: when control = y n y y 0 Add Sub control x n x x 0 c n n -bit adder c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Subtraction: when control = y n y y 0 Add Sub control x n x x 0 c n n -bit adder y n- y y 0 c 0 s n s s 0 [ Figure 3.2 from the textbook ]

Subtraction: when control = y n y y 0 Add Sub control x n x x 0 c n n -bit adder y n- y y 0 c 0 s n s s 0 carry for the first column! [ Figure 3.2 from the textbook ]

A Closer Look at the Control Circuit

Control Circuit [ Figure 7.9 from the textbook ]

Control Signals Clear FR in [ Figure 7.9 from the textbook ]

Design a FSM with input w and outputs R0 in R0 out R in R out R2 in R2 out A in Gin G out Clear AddSub Extern Done R3 in R3 out FR in

Design a FSM with input w and outputs R0 in R0 out R in R out A in Gin G out AddSub Extern Done T 0 T T 2 T 3 X 0 X X 2 X 3 R2 in R2 out Clear I 0 I Y 0 Y I 2 Y 2 R3 in FR in I 3 Y 3 R3 out These are helper outputs that are one-hot encoded. They are used to simplify the expressions for the other outputs.

The function register and decoders I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En Clock FR in Function Register f f 0 Rx Rx 0 Ry Ry 0 Function [ Figure 7. from the textbook ]

The function register and decoders I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En All three decoders are always enabled Clock FR in Function Register f f 0 Rx Rx 0 Ry Ry 0 Function [ Figure 7. from the textbook ]

Operations performed by this processor Operation Load Rx, Data Function Performed Rx ç Data Move Rx, Ry Rx ç [Ry] Add Rx, Ry Rx ç [Rx] + [Ry] Sub Rx, Ry Rx ç [Rx] - [Ry] [ Table 7. from the textbook ]

Operations performed by this processor Operation Load Rx, Data Function Performed Rx ç Data Move Rx, Ry Rx ç [Ry] Add Rx, Ry Rx ç [Rx] + [Ry] Sub Rx, Ry Rx ç [Rx] - [Ry] Where Rx and Ry can be one of four possible options: R0, R, R2, and R3 [ Table 7. from the textbook ]

Operations performed by this processor f f 0 Function 0 0 Load 0 Move 0 Add Sub Rx Rx 0 Register 0 0 R0 0 R 0 R2 R3 Ry Ry 0 Register 0 0 R0 0 R 0 R2 R3

Operations performed by this processor 0 0 0 è Move R3, R0 f f 0 Function 0 0 Load 0 Move 0 Add Sub Rx Rx 0 Register 0 0 R0 0 R 0 R2 R3 Ry Ry 0 Register 0 0 R0 0 R 0 R2 R3

The function register and decoders I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En Clock FR in Function Register f f 0 Rx Rx 0 Ry Ry 0 0 0 0 è Move R3, R0

The function register and decoders I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En Clock FR in 0 0 0 Function Register f f 0 Rx Rx 0 Ry Ry 0 0 0 0 è Move R3, R0

The function register and decoders I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 0 0 0 En Clock FR in 0 0 0 Function Register f f 0 Rx Rx 0 Ry Ry 0 0 0 0 è Move R3, R0

The function register and decoders 0 0 0 0 0 0 0 0 0 I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 0 0 0 En Clock FR in 0 0 0 Function Register f f 0 Rx Rx 0 Ry Ry 0 0 0 0 è Move R3, R0

The function register and decoders one-hot encoded one-hot encoded one-hot encoded 0 0 0 0 0 0 0 0 0 I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 0 0 0 En Clock FR in 0 0 0 Function Register f f 0 Rx Rx 0 Ry Ry 0 0 0 0 è Move R3, R0

Operations performed by this processor 0 0 è Add R, R3 f f 0 Function 0 0 Load 0 Move 0 Add Sub Rx Rx 0 Register 0 0 R0 0 R 0 R2 R3 Ry Ry 0 Register 0 0 R0 0 R 0 R2 R3

Operations performed by this processor 0 0 0 è Sub R0, R2 f f 0 Function 0 0 Load 0 Move 0 Add Sub Rx Rx 0 Register 0 0 R0 0 R 0 R2 R3 Ry Ry 0 Register 0 0 R0 0 R 0 R2 R3

Operations performed by this processor 0 0 0 x x è Load R2, Data f f 0 Function 0 0 Load 0 Move 0 Add Sub Rx Rx 0 Register 0 0 R0 0 R 0 R2 R3 Ry Ry 0 Register 0 0 R0 0 R 0 R2 R3

Similar Encoding is Used by Modern Chips [http://en.wikipedia.org/wiki/instruction_set]

Sample Assembly Language Program For This Processor Move R3, R0 Add R, R3 Sub R0, R2 Load R2, Data

Machine Language vs Assembly Language Machine Language Assembly Language Meaning / Interpretation 000 00 000 00000 Move R3, R0 Add R, R3 Sub R0, R2 Load R2, Data R3 ç [R0] R ç [R] + [R3] R0 ç [R0] [R2] R2 ç Data

Machine Language vs Assembly Language Machine Language Assembly Language Meaning / Interpretation 000 00 000 00000 Move Add Sub Load R3, R0 R, R3 R0, R2 R2, Data R3 ç [R0] R ç [R] + [R3] R0 ç [R0] [R2] R2 ç Data

Machine Language vs Assembly Language Machine Language Assembly Language Meaning / Interpretation 000 00 000 00000 Move R3, R0 Add R, R3 Sub R0, R2 Load R2, Data R3 ç [R0] R ç [R] + [R3] R0 ç [R0] [R2] R2 ç Data For short, each line can be expressed as a hexadecimal number

Machine Language vs Assembly Language Machine Language Assembly Language Meaning / Interpretation C 27 32 08 Move R3, R0 Add R, R3 Sub R0, R2 Load R2, Data R3 ç [R0] R ç [R] + [R3] R0 ç [R0] [R2] R2 ç Data

Intel 8086 [http://en.wikipedia.org/wiki/intel_8086]

Intel 8086 Memory Address [http://en.wikipedia.org/wiki/intel_8086]

Intel 8086 Machine Language [http://en.wikipedia.org/wiki/intel_8086]

Intel 8086 Assembly Language [http://en.wikipedia.org/wiki/intel_8086]

Intel 8086 Comments [http://en.wikipedia.org/wiki/intel_8086]

Another Part of The Control Circuit

A part of the control circuit for the processor T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter [ Figure 7.0 from the textbook ]

What are the components? T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter [ Figure 7.0 from the textbook ]

2-Bit Up-Counter T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter [ Figure 7.0 from the textbook ]

2-bit Synchronous Up-Counter T Q T Q Clock Q Q Clear_n

2-bit Synchronous Up-Counter with Enable Enable T Q T Q Clock Q Q Clear_n

2-to-4 Decoder with Enable Input T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter [ Figure 7.0 from the textbook ]

2-to-4 Decoder with an Enable Input En [ Figure 4.3c from the textbook ]

2-to-4 Decoder with an Enable Input (always enabled in this example) [ Figure 4.3c from the textbook ]

So How Does This Work? T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter

So How Does This Work? T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 Clock Clear 0 Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 Clock Clear Reset Q Q 0 Up-counter

So How Does This Work? 0 0 0 T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 0 0 Clock Clear Reset Q Q 0 Up-counter

Meaning/Explanation This is like a FSM that cycles through its four states one after another. But it also can be reset to go to state 0 at any time. The implementation uses a counter followed by a decoder. The outputs of the decoder are one-hotencoded. This is like choosing a state assignment for an FSM in which there is one Flip-Flop per state, i.e., one-hot encoding (see Section 6.2. in the textbook)

Deriving the Control Signals

Design a FSM with input w and outputs R0 in A in AddSub T 0 X 0 R0 out R in R out Gin G out Extern Done T T 2 T 3 X X 2 X 3 R2 in R2 out Clear I 0 I Y 0 Y I 2 Y 2 R3 in R3 out FR in I 3 Y 3 These are helper outputs that are one-hot encoded. They are used to simplify the expressions for the other outputs.

Control Signals [ Figure 7.9 from the textbook ]

Control Signals [ Figure 7.9 from the textbook ]

Another Control Signal I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En 2-to-4 decoder w w 0 En Clock FR in Function Register f f 0 Rx Rx 0 Ry Ry 0 [ Figure 7. from the textbook ]

Yet Another Control Signal T 0 T T 2 T 3 y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock Clear Reset Q Q 0 Up-counter [ Figure 7.0 from the textbook ]

Expressing the 'FR in ' signal I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 T 0 T T 2 T 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 En y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock FR in Function Register Clock Clear Reset Q Q 0 Up-counter f f 0 Rx Rx 0 Ry Ry 0 FR in = w T 0 Load a new operation into the function register

Expressing the 'Clear' signal I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 T 0 T T 2 T 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 En y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock FR in Function Register Clock Clear Reset Q Q 0 Up-counter f f 0 Rx Rx 0 Ry Ry 0 Clear = w T 0 + Done Reset the counter when Done or when w=0 and no operation is being executed (i.e., T 0 =).

Control signals asserted in each time step T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done [ Table 7.2 from the textbook ]

Control signals asserted in each time step T T 2 T 3 Time (Load): I 0 (Move): I (Add): I 2 (Sub): I 3 Extern R in = X Done R in = X R out = Y Done R out = X A in R out = X A in R out = Y G in AddSub = 0 R out = Y G in AddSub = These are the outputs of the first 2-to-4 decoder that is connected to the two most significant bits of the function register. They are one-hot encoded so only one of them is active at any given time (see Fig 7.). G out R in = X Done G out R in = X Done These come from the outputs of the 2-to-4 decoder in Figure 7.0. They are also one-hot encoded. [ Table 7.2 from the textbook ]

The I 0, I,I 2, I 3 and T 0,T,T 2,T 3 Signals I 0 I I 2 I 3 X 0 X X 2 X 3 Y 0 Y Y 2 Y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 y 0 y y 2 y 3 T 0 T T 2 T 3 2-to-4 decoder 2-to-4 decoder 2-to-4 decoder w w 0 En w w 0 En w w 0 En y 0 y y 2 y 3 2-to-4 decoder w w 0 En Clock FR in Function Register Clock Clear Reset Q Q 0 Up-counter f f 0 Rx Rx 0 Ry Ry 0 [ Figure 7. from the textbook ] [ Figure 7.0 from the textbook ]

Different Operations Take Different Amount of Time T T 2 T 3 (Load): I 0 Extern R in = X Done clock cycle (Move): I R in = X R out = Y Done clock cycle (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done 3 clock cycles (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done 3 clock cycles [ Table 7.2 from the textbook ]

Operations performed by this processor Operation Load Rx, Data Function Performed Rx ç Data Move Rx, Ry Rx ç [Ry] Add Rx, Ry Rx ç [Rx] + [Ry] Sub Rx, Ry Rx ç [Rx] - [Ry] Where Rx and Ry can be one of four possible options: R0, R, R2, and R3 [ Table 7. from the textbook ]

Simple Processor [ Figure 7.9 from the textbook ]

Expressing the 'Extern' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done Extern = I 0 T

Expressing the 'Done' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done Done = (I 0 + I )T + (I 2 + I 3 )T 3

Expressing the 'A in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done A in = (I 2 + I 3 )T

Expressing the 'G in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done G in = (I 2 + I 3 )T 2

Expressing the 'G out ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done G out = (I 2 + I 3 )T 3

Expressing the 'AddSub' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done AddSub = I 3

Expressing the 'R0 in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R0 in = (I 0 + I )T X 0 + (I 2 + I 3 )T 3 X 0

Expressing the 'R in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R in = (I 0 + I )T X + (I 2 + I 3 )T 3 X

Expressing the 'R2 in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R2 in = (I 0 + I )T X 2 + (I 2 + I 3 )T 3 X 2

Expressing the 'R3 in ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R3 in = (I 0 + I )T X 3 + (I 2 + I 3 )T 3 X 3

Expressing the 'R0 out ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R0 out = I T Y 0 + (I 2 + I 3 ) ( T X 0 + T 2 Y 0 )

Expressing the 'R out ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R out = I T Y + (I 2 + I 3 ) ( T X + T 2 Y )

Expressing the 'R2 out ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R2 out = I T Y 2 + (I 2 + I 3 ) ( T X 2 + T 2 Y 2 )

Expressing the 'R3 out ' signal T T 2 T 3 (Load): I 0 Extern R in = X Done (Move): I R in = X R out = Y Done (Add): I 2 R out = X A in R out = Y G in AddSub = 0 G out R in = X Done (Sub): I 3 R out = X A in R out = Y G in AddSub = G out R in = X Done R3 out = I T Y 3 + (I 2 + I 3 ) ( T X 3 + T 2 Y 3 )

Derivation of the Control Inputs For more insights into these derivations see pages 434 and 435 in the textbook

Some Additional Topics

The ALU for the Simple Processor For this ALU, A+B if AddSub= A-B if AddSub=0 [ Figure 7.9 from the textbook ]

Another Arithmetic Logic Unit (ALU) Arithmetic Logic Unit (ALU) computes arithmetic or logic functions Example: A four-function ALU has two selection bits S S0 (also called OpCode) to specify the function 00 (ADD), 0 (SUB), 0 (AND), (OR) Then the following set up will work A B A B A B A B ADD SUB AND OR 00 0 MUX 0 S S0 Result A B S S0 Function 0 0 ADD 0 SUB 0 AND OR A L U Result Symbol S S0 (OpCode)

An Alternative Design of Four-Function ALU The previous design is not very efficient as it uses an adder and a subtractor circuit We can design an add/subtract unit as discussed earlier Then we can design a logical unit (AND and OR) separately Then select appropriate output as result What are the control signals, Add/Sub, Select0, and Select? A B A B A B Add/Sub ADD/SUB 0 MUX AND 0 MUX OR Select0 Select Result S S0 Function 0 0 ADD 0 SUB 0 AND OR

Examples of Some Famous Microprocessors

Intel's 4004 Chip [http://en.wikipedia.org/wiki/intel_4004]

Technical specifications Maximum clock speed was 740 khz Instruction cycle time: 0.8 µs (8 clock cycles / instruction cycle) Instruction execution time or 2 instruction cycles (0.8 or 2.6 µs), 46300 to 92600 instructions per second Built using 2,300 transistors [http://en.wikipedia.org/wiki/intel_4004]

Technical specifications Separate program and data storage. The 4004, with its need to keep pin count down, used a single multiplexed 4-bit bus for transferring: 2-bit addresses 8-bit instructions 4-bit data words Instruction set contained 46 instructions (of which 4 were 8 bits wide and 5 were 6 bits wide) Register set contained 6 registers of 4 bits each Internal subroutine stack, 3 levels deep. [http://en.wikipedia.org/wiki/intel_4004]

[http://en.wikipedia.org/wiki/intel_4004]

[http://en.wikipedia.org/wiki/intel_4004]

Intel's 8086 Chip [http://en.wikipedia.org/wiki/intel_8086]

[http://en.wikipedia.org/wiki/intel_8086]

[http://en.wikipedia.org/wiki/intel_8086] Simplified block diagram of Intel 8088 (a variant of 8086); =main registers; 2=segment registers and IP; 3=address adder; 4=internal address bus; 5=instruction queue; 6=control unit (very simplified!); 7=bus interface; 8=internal databus; 9=ALU; 0//2=external address/ data/control bus.

Questions?

THE END