Digital Logic Last Time … This Time … Control Path, Arithmetic Ops a

Slides:



Advertisements
Similar presentations
Adding the Jump Instruction
Advertisements

CBP Comp 1017 Digital Technologies1 Let’s make a Computer.
L14 – Control & Execution 1 Comp 411 – Fall /04/09 Control & Execution Finite State Machines for Control MIPS Execution.
Computer ArchitectureFall 2007 © October 3rd, 2007 Majd F. Sakr CS-447– Computer Architecture.
CPEN Digital System Design Chapter 9 – Computer Design
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 4:
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Computer Fundamentals ELEC 330 Digital Systems Engineering Dr. Ron Hayne.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
EKT221 ELECTRONICS DIGITAL II CHAPTER 4: Computer Design Basics
Princess Sumaya Univ. Computer Engineering Dept. Chapter 5:
Lec 15Systems Architecture1 Systems Architecture Lecture 15: A Simple Implementation of MIPS Jeremy R. Johnson Anatole D. Ruslanov William M. Mongan Some.
Gary MarsdenSlide 1University of Cape Town Chapter 5 - The Processor  Machine Performance factors –Instruction Count, Clock cycle time, Clock cycles per.
Exam 2 Review Two’s Complement Arithmetic Ripple carry ALU logic and performance Look-ahead techniques Basic multiplication and division ( non- restoring)
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
CBP 2002ITY 270 Computer Architecture1 Digital Logic This Time … Control Path, Arithmetic Ops 12 a U1 34 b Last Time …
CBP 2006Comp 4070 Concepts and Philosophy of Computing 1 Wrestling with Complex Stuff. With the Correct Approach, even the smallest guy will succeed!
Our programmer needs to do this !
Computer Architecture Lecture 9 MIPS ALU and Data Paths Ralph Grishman Oct NYU.
Gates AND, OR, NOT NAND, NOR Combinational logic No memory A set of inputs uniquely and unambiguously specifies.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Logic Gates Dr.Ahmed Bayoumi Dr.Shady Elmashad. Objectives  Identify the basic gates and describe the behavior of each  Combine basic gates into circuits.
More on Digital Logic Devices and Circuits Trac D. Tran ECE Department The Johns Hopkins University Baltimore, MD
CS231: Computer Architecture I Laxmikant Kale Fall 2002.
1 (Based on text: David A. Patterson & John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 3 rd Ed., Morgan Kaufmann,
REGISTER TRANSFER AND MICROOPERATIONS
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Combinational Circuits
CS161 – Design and Architecture of Computer Systems
CS 270: Mathematical Foundations of Computer Science
CS161 – Design and Architecture of Computer Systems
Combinational circuits
REGISTER TRANSFER AND MICROOPERATIONS
Control & Execution Finite State Machines for Control MIPS Execution.
COMP541 Datapaths I Montek Singh Mar 28, 2012.
Chap 7. Register Transfers and Datapaths
IT 251 Computer Organization and Architecture
Processor (I).
The fetch-execute cycle
Control & Execution Finite State Machines for Control MIPS Execution.
Single-Cycle CPU DataPath.
Datapath & Control MIPS
Rocky K. C. Chang 6 November 2017
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
CS/COE0447 Computer Organization & Assembly Language
Guest Lecturer TA: Shreyas Chand
CS/COE0447 Computer Organization & Assembly Language
22 October 3 classes before 2nd exam! Control 1/16/2019
Systems Architecture I
COMS 361 Computer Organization
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
COMS 361 Computer Organization
Logic Circuits I Lecture 3.
COMP541 Datapaths I Montek Singh Mar 18, 2010.
Combinational Circuits
Review Fig 4.15 page 320 / Fig page 322
Electronics for Physicists
October 29 Review for 2nd Exam Ask Questions! 4/26/2019
Lecture 6 CdM-8 CPU overview
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/09/29
Digital Circuits and Logic
Instruction execution and ALU
Computer Architecture Assembly Language
COMS 361 Computer Organization
What You Will Learn In Next Few Sets of Lectures
Processor: Datapath and Control
Presentation transcript:

Digital Logic Last Time … This Time … Control Path, Arithmetic Ops a 1 2 a U1 3 4 b This Time … Control Path, Arithmetic Ops CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Digital Logic Where? Control Circuits – CPU control path - system board (later) ALU Structure – add, sub, and, or, not Data Memory Code Memory ALU X Y W 1 7 MUXES Address Decoder CBP 2002 ITY 270 Computer Architecture

Boolean Notation, Truth Tables 1 A B O A and B Easy Way to write truth tables - count in binary ! AB A B O 1 A B C 1 A or B A B O A + B A O A O 1 NOT A A _ CBP 2002 ITY 270 Computer Architecture

Digi Logic Design 1 - use Gates B O Comparator Circuit – outputs a ‘1’ if A and B are equal, else ouput a ‘0’ 2. Make each individual term A B O 1 1 1 1 3. Combine the terms with OR gate 1. Look for lines with out = ‘1’ CBP 2002 ITY 270 Computer Architecture

… again with Boolean Algebra 1 _ _ “Not A and Not B” AB AB “A and B” _ _ _ A AB + AB _ A AB _ B B AB CBP 2002 ITY 270 Computer Architecture

Address Decoder Exercise B O4 A B O1 O2 O3 O4 1 O1 = AB _ A B CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Decoder Application Selecting Registers, e.g, add r2,r1,r0 r1 r2 r0 X Y W add rd rs rt unused decoder MIPS has 5-bit fields for registers, so are 32 r0 r0 r0 cs Registers CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture MUX Exercise A B Op C A B O C = 0 C A B O 1 A B O C = 1 What is MUX doing here ? CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture MUX is a Selector A A B Op C B C CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Multibit MUX A A B O C B C CBP 2002 ITY 270 Computer Architecture

MUX Application Y’ Y Selection of Datapath into one ALU input. Datapath Y from instruction add r2,r0,r1 ALU Y Datapth Y’ from instruction addi r2,r0,4 Sam has been designed so all immediate constants come in via Y’ add rd rs rt unused Immediate bit of op-code CBP 2002 ITY 270 Computer Architecture

Multiplexed Address/Data Bus, e.g. PCI Bus Address/Data Bus MUXing CPU MEM addr data CPU MEM add/dat address address data data Pentium System Bus Multiplexed Address/Data Bus, e.g. PCI Bus CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Digi design 2 - use MUXes A B O I1 1 I2 I3 I4 A B O 1 A B Op 0 0 0 1 1 0 1 1 1 A B Op In 1 In 2 In 3 In 4 “ Muxes can be used to implement arbitrary combinatorial circuits “ CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture MUX Design Exercise 3 input parity detector A B C O 1 CBP 2002 ITY 270 Computer Architecture

Designing Using ROM/RAM B O 0 0 0 1 1 0 1 1 1 0 1 1 0 O 1 1 1 0 O A B O 0 0 0 1 1 0 1 1 1 decoder A B Several MUX’es fed with the same AB produce a multibit output. So does a ROM or RAM. CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Programmable Logic Arrays _ ABC Fuse majority CBP 2002 ITY 270 Computer Architecture

Addition of Binary Numbers 1 0 A 1 1 A B B 0 1 1 0 Carry = 0 Sum = 1 Carry = 1 Sum = 0 1 1 0 1 1 0 0 Multibit add - cascade sum and carry ops. CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Full Adder A A B Ci S Co 1 S Co 1 Carry In B Full Adder Carry Out Sum CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Full Adder A B C 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 A B C 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 1 1 A B Ci O Co 1 O Co 1 CARRY SUM CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture 4-bit Adder a3 a2 a1 a0 b3 b2 b1 b0 Full Adder Full Adder Full Adder Full Adder Carry Out s3 s3 s3 s3 CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Let’s Build an ALU Carry In A B + Carry Out S1 S0 CBP 2002 ITY 270 Computer Architecture

Issues Concerning Numbers Multiplication and Division Subtraction Negative Numbers Fractional and Real Numbers Characters and Strings CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Sequential Circuits Traffic Lights Washing Machines Fetch-Execute Cycle CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Counters Clock 4-bit Counter 0 1 0 0 (4) Reset T0 T1 T2 T3 T4 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 How to get this to sequence 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 ? CBP 2002 ITY 270 Computer Architecture

Traffic Light Sequencing Clock T0 T1 T2 T3 4-bit Counter Reset T2 T1 0 1 0 0 (4) Combinatorial Logic T3 T0 CBP 2002 ITY 270 Computer Architecture

Fetch Execute Sequencing Decode, Reg Op ALU Op Mem Access Reg Write 3 1 + -- ALU Counter Decoder Clock ALU Data Memory Code Memory ALU X Y W 1 7 CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Representing Numbers 000 110 001 100 010 011 101 111 5 1 7 2 6 4 3 000 110 001 100 010 011 101 111 -3 1 -1 2 -2 -4 3 Let’s take some 3-bit numbers. “2’s Complement” – complement it (0->1 and 1->0) then add 1 CBP 2002 ITY 270 Computer Architecture

2’s Complement Properties Most Significant Bit (MSB) gives sign. 000 110 001 100 010 011 101 111 -3 1 -1 2 -2 - 4 3 Addition ? 0 0 1 0 1 0 0 1 1 1 2 3 1 1 1 1 1 0 1 0 1 -1 -2 -3 Subtraction by Addition 0 0 1 1 1 1 0 0 0 1 -1 0 0 1 1 1 1 0 0 0 1 3 -2 1 MSB is Sign Bit ! 3 - 2 = 3 + (-2) = 1 CBP 2002 ITY 270 Computer Architecture

Subtraction by Addition Full Adder a3 a2 a1 a0 b3 b2 b1 b0 s3 1 CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture HEX and Chars Binary Hex 0 0 0 0 0 0 0 1 1 0 0 1 0 2 0 0 1 1 3 0 1 0 0 4 0 1 0 1 5 0 1 1 0 6 0 1 1 1 7 1 0 0 0 8 1 0 0 1 9 1 0 1 0 A 1 0 1 1 B 1 1 0 0 C 1 1 0 1 D 1 1 1 0 E 1 1 1 1 F Hexadecimal Shorthand each nibble rep’d as a character … 1 0 1 1 0 1 1 1 B 7 Useful in Machine Level Programming and HTML scripting UNICODE HEX Ascii 30 41 A 61 a 6D m 0D CR ASCII CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Multiplication 1 3 1 2 2 6 1 3 0 1 5 6 1 1 2 1 2 2 0 2 3 1 x 1 x x CBP 2002 ITY 270 Computer Architecture

ITY 270 Computer Architecture Multiplication A B 1 1 0 1 0 0 0 0 1 0 1 1 C Add/no-add A adder B 1 C - Initial values Add A to B SHR No Add Add A to B. Then Shift Right (SHR). Look at LSB bit. If this is 1 then Add A to B. A = B = AxB = CBP 2002 ITY 270 Computer Architecture