CS/COE0447: Computer Organization

Similar documents
CS/COE0447: Computer Organization

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

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

CS/COE0447: Computer Organization and Assembly Language

Lecture 13: Sequential Circuits, FSM

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

Lecture 7: Logic design. Combinational logic circuits

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

Latches. October 13, 2003 Latches 1

Chapter 4. Sequential Logic Circuits

Digital Logic Appendix A

Sequential Logic Circuits

Lecture 13: Sequential Circuits, FSM

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

CSC9R6 Computer Design. Practical Digital Logic

CS470: Computer Architecture. AMD Quad Core

Fundamentals of Digital Design

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

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

Philadelphia University Student Name: Student Number:

CS61C : Machine Structures

ELCT201: DIGITAL LOGIC DESIGN

ECE/CS 250 Computer Architecture

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

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

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

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

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

SAU1A FUNDAMENTALS OF DIGITAL COMPUTERS


Review for B33DV2-Digital Design. Digital Design

CS61C : Machine Structures

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

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

Lecture 22 Chapters 3 Logic Circuits Part 1

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

ECE/CS 250: Computer Architecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Benjamin Lee

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

CMPE12 - Notes chapter 1. Digital Logic. (Textbook Chapter 3)

Reg. No. Question Paper Code : B.E./B.Tech. DEGREE EXAMINATION, NOVEMBER/DECEMBER Second Semester. Computer Science and Engineering

Review for Final Exam

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

Chapter 3 Digital Logic Structures

Lecture 3 Review on Digital Logic (Part 2)

Boolean algebra. Examples of these individual laws of Boolean, rules and theorems for Boolean algebra are given in the following table.

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Chapter 7. Sequential Circuits Registers, Counters, RAM

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

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

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

Principles of Computer Architecture. Appendix B: Reduction of Digital Logic. Chapter Contents

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

DIGITAL LOGIC CIRCUITS

CSC 322: Computer Organization Lab

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

Switches: basic element of physical implementations

DIGITAL LOGIC CIRCUITS

EEE130 Digital Electronics I Lecture #4

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Fundamentals of Computer Systems

Synchronous Sequential Logic

Systems I: Computer Organization and Architecture

Combinational vs. Sequential. Summary of Combinational Logic. Combinational device/circuit: any circuit built using the basic gates Expressed as

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

Sample Test Paper - I

Review for Test 1 : Ch1 5

Chapter 7 Logic Circuits

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

ECE 2300 Digital Logic & Computer Organization

UNIVERSITY OF WISCONSIN MADISON

Sequential Circuit Analysis

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

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

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

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

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

Time Allowed 3:00 hrs. April, pages

Design of Sequential Circuits

4 Switching Algebra 4.1 Axioms; Signals and Switching Algebra

DHANALAKSHMI COLLEGE OF ENGINEERING, CHENNAI DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS6201 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Computer organization

CHAPTER1: Digital Logic Circuits Combination Circuits

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

ALU A functional unit

Lecture A: Logic Design and Gates

Department of Electrical & Electronics EE-333 DIGITAL SYSTEMS

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

Chapter 14 Sequential logic, Latches and Flip-Flops

2. Associative Law: A binary operator * on a set S is said to be associated whenever (A*B)*C = A*(B*C) for all A,B,C S.

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Digital Logic (2) Boolean Algebra

Floating Point Representation and Digital Logic. Lecture 11 CS301

ENGG 1203 Tutorial_9 - Review. Boolean Algebra. Simplifying Logic Circuits. Combinational Logic. 1. Combinational & Sequential Logic

CS 226: Digital Logic Design

KUMARAGURU COLLEGE OF TECHNOLOGY COIMBATORE

CS61c: Representations of Combinational Logic Circuits

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

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

Transcription:

CS/COE0447: Computer Organization and Assembly Language Logic Design Review Sangyeun Cho Dept. of Computer Science Logic design? Digital hardware is implemented by way of logic design Digital circuits process and produce two discrete values: 0 and 1 Example: 1-bit full adder (FA) 2

Layered design approach Logic design is done using logic gates Often we design desired function using high-level languages and somewhat higher level than logic gates Two approaches in design Top down Bottom up Microarchitecture Function blocks Logic gates Transistors 3 Transistor as a switch X X X G G=1 G=0 N -type TR Y X Y X Y X G G=0 G=1 P -type TR Y Y Y 4

An inverter 1 P -type TR A Y N -type TR 0 5 When A = 1 1 P -type TR OFF A=1 Y=0 N -type TR ON 0 6

When A = 0 1 P -type TR ON A=0 Y=1 N -type TR OFF 0 7 Abstraction 1 P -type TR A Y A Y N -type TR 0 8

Logic gates 2-input AND A B Y Y=A & B 2-input OR A B Y Y=A B 2-input NAND A B Y Y=~(A & B) 2-input NOR A B Y Y=~(A B) 9 Describing a function Output A = F(Input 0, Input 1,, Input N 1 ) Output B = F (Input 0, Input 1,, Input N 1 ) Output C = F (Input 0, Input 1,, Input N 1 ) Methods Truth table Sum of products Product of sums 10

Truth table Input Output A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 11 Sum of products Input Output A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 S = A B C ABC in + A BC in + AB C in + ABC in C out = A BC in + AB C in + ABC in + ABC in 12

Combinational vs. sequential logic Combinational logic = function A function whose outputs are dependent only on the current inputs As soon as inputs are known, outputs can be determined Sequential logic = combinational logic + memory Some memory elements (i.e., state ) Outputs t are dependent d on the current state t and the current inputs Next state is dependent on the current state and the current inputs 13 Combinational logic inputs outputs 14

Sequential logic inputs outputs current state next state clock 15 Combinational logic Any combinational logic can be implemented using sum of products or product of sums Input-output relationship can be defined in the truth table format From the truth table, each output function can be derived Boolean expressions can be further manipulated (e.g., to reduce cost) using various Boolean algebraic rules 16

Boolean algebra Boole, George (1815~1864): mathematician and philosopher; inventor of Boolean Algebra, the basis of all computer arithmetic Binary values: {0,1} Two binary operations: AND ( / ), OR (+) One unary operation: NOT (~) 17 Boolean algebra Binary operations: AND ( / ), OR (+) Idempotent a a = a+a= a Commutative a b = b a a+b = b+a Associative a (b c) = (a b) c a+(b+c) = (a+b)+c Distributive (b+ ) b + a (b+c) = a b + a c a+(b c) = (a+b) (a+c) 18

Boolean algebra De Morgan s laws ~(a+b) = ~a ~b ~(a b) = ~a+~b More a+(a b) = a a (a+b) = a ~~a = a a+~a = 1 a (~a) = 0 19 Expressive power With AND/OR/NOT, we can express any function in Boolean algebra Sum (+) of products ( ) What if we have NAND/NOR/NOT? What if we have NAND only? What if we have NOR only? 20

Multiplexor (aka MUX) A 0 Y B 1 S Y = (S)? B:A; 21 A 32-bit MUX 22

Simplifying expressions Input Output A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 C out = A BC ABC in + AB C in + ABC in + ABC in C out = BC in + AC in + AB 23 Karnaugh map BC in A 0 1 00 0 0 01 0 1 AC in 11 1 1 10 0 1 BC in AB C out = BC in +AB+AC in 24

Building a 1-bit ALU ALU = arithmetic logic unit = arithmetic unit + logic unit 25 Building a 32-bit ALU 26

Implementing sub 27 Implementing NAND and NOR 28

Implementing SLT (set-less-than) than) 1-bit ALU for bits 0~30 1-bit ALU for bit 31 29 Implementing SLT (set-less-than) than) 30

Supporting BEQ and BNE zero detector 31 Abstracting ALU Note that ALU is a combinational logic 32

RS latch Beware of the feedback! 33 RS latch 0 1 0 1 1 0 When R=0, S=1 34

RS latch 1 0 1 0 0 1 When R=1, S=0 35 RS latch 0 0 1 0 0 1 When R=0, S=0, and Q was 0 36

RS latch 0 1 0 1 0 0 When R=0, S=0, and Q was 1 37 RS latch 1 1 What happens if R=S=1 38

D latch Note that we have an RS latch in the back-end of this design 39 D latch R S Note that R, S inputs always get opposite values when C=1 When C=0, S=R=0 RS latch remembers the previous value 40

D latch R latched mode C D Q(t) 0 0 Q(t-1) 0 1 Q(t-1) S 1 0 0 1 1 1 transparent mode 41 D latch D C D Latch Q Q 42

D flip-flop flop (D-FF) Two cascaded D latches; C input of the second is inverted This is a negative edge triggered D-FF 43 D flip-flop flop D Q D-FF C Q 44

Finite state machine (FSM) 45 Traffic light control example Two states NSlite: green light on North-South road EWlite: green light on East-West road Current state goes for 30 seconds, then Switch to the other state if there is a car waiting Current state goes for another 30 seconds if not We use 1/30 Hz clock 46

Traffic light control example 47 Traffic light control example 48

Traffic light control example Let s assign 0 to NSlite and 1 to EWlite initially NextState = CurrentState EWcar + CurrentState NScar NSlite = CurrentState EWlite = CurrentState 49 How do I implement a logic design? Various ways to implement your design Use 74* chips (you may need many of those for even a very simple design) Use PLA (Programming g Logic Array) Use FPGA (Field Programmable Gate Array) ASIC (Application Specific Integrated t Circuits) it Most capable approach (in terms of design size and performance); however, there is a large fixed development cost. This approach is justified tifid only for volume products 50

Using 74* 74 chips 51 Using 74* 74 chips Breadboard +74* chips 52

Using a PLA It s a programmable device You can implement your own (complex) combinational logic (=function) using a single PLA A PLA device is much more capable than individual 74* chips Much denser (that means you can implement many functions) Internally, PLA implements a function of the sum-ofproduct format AND plane for product terms OR plane for summing products 53 PLA design of ALU control logic products sums 54

FPGA FPGA is even more capable (millions of gates) Combinational logic Sequential logic Memory arrays Even some embedded d microprocessor cores I/O support such as Ethernet MAC (media access control) block Best of all, it s field programmable and affordable 55 To wrap up In digital logic, transistors are used as simple switches Logic gates are an abstraction of a transistor network A combinational i logic block has inputs and outputs whose values are immediately determined as inputs become known A sequential logic block is composed of a combinational logic block and memory elements 56

To wrap up Boolean algebra provides a theoretical foundation for digital logic Starting from two transistors (N-type and P-type), we ve built logic gates and more complex structures (bottom up) An ALU for the MIPS architecture has been built! 57 To wrap up Flip-flops p (FFs) were used as a memory element A finite state machine (FSM) can be implemented using FFs and some combinational logic 58