CS429: Computer Organization and Architecture

Similar documents
Topics of this Slideset. CS429: Computer Organization and Architecture. Digital Signals. Truth Tables. Logic Design

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 3, 2015

CS 31: Intro to Systems Digital Logic. Kevin Webb Swarthmore College February 2, 2016

CISC 360 Midterm Exam - Review Alignment

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Digital Design with FPGAs. By Neeraj Kulkarni

CS:APP Chapter 4 Computer Architecture Logic Design Randal E. Bryant Carnegie Mellon University

CS 261 Fall Mike Lam, Professor. Logic Gates

CS 261 Fall Mike Lam, Professor. Combinational Circuits

problem maximum score 1 8pts 2 6pts 3 10pts 4 15pts 5 12pts 6 10pts 7 24pts 8 16pts 9 19pts Total 120pts

UNIT - V MEMORY P.VIDYA SAGAR ( ASSOCIATE PROFESSOR) Department of Electronics and Communication Engineering, VBIT

Writing Circuit Descriptions 8

ELCT 501: Digital System Design

EECS150, Fall 2004, Midterm 1, Prof. Culler. Problem 1 (15 points) 1.a. Circle the gate-level circuits that DO NOT implement a Boolean AND function.

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

6.1 Combinational Circuits. George Boole ( ) Claude Shannon ( )

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Memory Supplement for Section 3.6 of the textbook

Digital Logic the Bare Minimum

falling edge Intro Computer Organization

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

LECTURE 4. Logic Design

Topic #6. Processor Design

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

CS 31: Intro to Systems Digital Logic

CSEE 3827: Fundamentals of Computer Systems. Storage

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

Synthesizable Verilog

CHAPTER 4: Register Transfer Language and Microoperations

REGISTER TRANSFER LANGUAGE

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

REGISTER TRANSFER AND MICROOPERATIONS

CS61C : Machine Structures

Memory and Programmable Logic

Code No: R Set No. 1

One and a half hours. Section A is COMPULSORY UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

COMPUTER ARCHITECTURE AND ORGANIZATION Register Transfer and Micro-operations 1. Introduction A digital system is an interconnection of digital

Microcomputers. Outline. Number Systems and Digital Logic Review

BUILDING BLOCKS OF A BASIC MICROPROCESSOR. Part 1 PowerPoint Format of Lecture 3 of Book

ENEE245 Digital Circuits and Systems Lab Manual

Combinational and sequential circuits (learned in Chapters 1 and 2) can be used to create simple digital systems.

REGISTER TRANSFER AND MICROOPERATIONS

ENEE245 Digital Circuits and Systems Lab Manual

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

DIGITAL SYSTEM DESIGN

(ii) Simplify and implement the following SOP function using NOR gates:

The Memory Component

Lecture 15: System Modeling and Verilog

Levels in Processor Design

Reference Sheet for C112 Hardware

Digital Circuit Design and Language. Datapath Design. Chang, Ik Joon Kyunghee University

Computer Organization. 8th Edition. Chapter 5 Internal Memory

Computer Architecture (TT 2012)

Code No: R Set No. 1

A Brief Introduction to Verilog Hardware Definition Language (HDL)

10/5/2016. Review of General Bit-Slice Model. ECE 120: Introduction to Computing. Initialization of a Serial Comparator

Digital Design with SystemVerilog

Hardware Description Language VHDL (1) Introduction

ARM 64-bit Register File

ACS College of Engineering. Department of Biomedical Engineering. Logic Design Lab pre lab questions ( ) Cycle-1

N-input EX-NOR gate. N-output inverter. N-input NOR gate

DIGITAL SYSTEM DESIGN

Systems Architecture I

CSE 140L Final Exam. Prof. Tajana Simunic Rosing. Spring 2008

3. Implementing Logic in CMOS

EE577A FINAL PROJECT REPORT Design of a General Purpose CPU

Mark Redekopp, All rights reserved. EE 352 Unit 8. HW Constructs

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

Picture of memory. Word FFFFFFFD FFFFFFFE FFFFFFFF

LABORATORY MANUAL VLSI DESIGN LAB EE-330-F

Lecture #1: Introduction

CSE140L: Components and Design Techniques for Digital Systems Lab

ECE 341 Midterm Exam

3. The high voltage level of a digital signal in positive logic is : a) 1 b) 0 c) either 1 or 0

FPGA: FIELD PROGRAMMABLE GATE ARRAY Verilog: a hardware description language. Reference: [1]

FPGA for Complex System Implementation. National Chiao Tung University Chun-Jen Tsai 04/14/2011

ECE 550D Fundamentals of Computer Systems and Engineering. Fall 2017

CS429: Computer Organization and Architecture

Topics. Midterm Finish Chapter 7

II/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION. Answer ONE question from each unit.

Field Programmable Gate Array

CS429: Computer Organization and Architecture

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

Chapter 5 Internal Memory

Storage Elements & Sequential Circuits

CSE140L: Components and Design

Federal Urdu University of Arts, Science and Technology, Islamabad VLSI SYSTEM DESIGN. Prepared By: Engr. Yousaf Hameed.

CS222: Processor Design

Henry Lin, Department of Electrical and Computer Engineering, California State University, Bakersfield Lecture 7 (Digital Logic) July 24 th, 2012

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

Hardware Description Languages: Verilog. Quick History of HDLs. Verilog/VHDL. Design Methodology. Verilog Introduction. Verilog.

Digital Logic & Computer Design CS Professor Dan Moldovan Spring 2010

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

DIGITAL ELECTRONICS. P41l 3 HOURS

Hardware Description Languages: Verilog

Overview. CSE372 Digital Systems Organization and Design Lab. Hardware CAD. Two Types of Chips

CENG 241 Digital Design 1

Transcription:

CS429: Computer Organization and Architecture Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: January 2, 2018 at 11:23 CS429 Slideset 5: 1

Topics of this Slideset To execute a program we need: Communication: getting data from one place to another Computation: perform arithmetic or logical operations Memory: store the program, variables, results Everything is expressed in terms of bits (0s and 1s). Communication: Low or high voltage on a wire Computation: Compute boolean functions Storage: Store bits CS429 Slideset 5: 2

Digital Signals Use voltage thesholds to extract discrete values from a continuous signal. Simplest version: 1-bit signal Either high range (1) or low range (0) With a guard range between them. Not strongly affected by noise or low-quality elements; circuits are simple, small and fast. CS429 Slideset 5: 3

Truth Tables And: A & B = 1 when both A = 1 and B = 1. 0 1 & 0 0 0 0 1 0 1 0 0 1 1 1 Or: A B = 1 when either A = 1 or B = 1. 0 1 0 0 0 0 1 1 1 0 1 1 1 1 Not: ~A = 1 when A = 0. 0 ~ 0 1 1 0 Xor: A ˆ B = 1 when either A = 1 or B = 1, but not both. 0 1 ˆ 0 0 0 0 1 1 1 0 1 1 1 0 CS429 Slideset 5: 4

Computing with Logic Gates How are these logic functions actually computed in hardware? Logic gates are constructed from transistors. The output is a boolean function of inputs. The gate responds continuously to changes in input with a small delay. How many of these do you really need? CS429 Slideset 5: 5

Aside: Multiple-Input Gates Some gates allow multiple inputs. For example, a 3-input AND is essentially just a cascade of two 2-input ANDs. For which gates does it make sense to have extra inputs? For which doesn t it make sense? CS429 Slideset 5: 6

Aside: Inverted Inputs/Outputs A small circle on either the input or output of a gate means that that signal is inverted. That is, it s as if there were an inverter (not) gate there. CS429 Slideset 5: 7

A Complex Function Simple boolean functions are implemented by logic gates; more complex functions, by combinations of gates. A B C Z 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 Z =!A (B && C); CS429 Slideset 5: 8

Another Circuit Can you see what this circuit does? CS429 Slideset 5: 9

Another Circuit Can you see what this circuit does? This is called a majority circuit. What function does it compute? CS429 Slideset 5: 10

Sets of Logic Gates It s pretty easy to see that any boolean function can be implemented with AND, OR and NOT. Why? We call that a functionally complete set of gates. You can get by with fewer gates. How would you show each of the following? AND and NOT is complete. OR and NOT is complete. NAND is complete. NOR is complete. AND alone is not complete. OR alone is not complete. Often circuit designers will restrict themselves to a small subset of gates (e.g., just NAND gates). Why would they do that? CS429 Slideset 5: 11

Using Logic for Arithmetic Suppose you wanted to do addition with logic. How might you go about that? CS429 Slideset 5: 12

Using Logic for Arithmetic Suppose you wanted to do addition with logic. How might you go about that? Define a circuit (full adder) that does one step in an addition: a b carry in Full Adder c carry out A B Cin Cout S 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 CS429 Slideset 5: 13

Full Adder The following circuit is a 1-bit (full) adder: A B Cin Cout S 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 CS429 Slideset 5: 14

Adding a Pair of 4-bit Ints How do you subtract? How do you multiply? CS429 Slideset 5: 15

Combinational Circuits The box contains an acyclic network of logic gates. Continuously responds to changes in inputs. Outputs become (after a short delay) boolean functions of the inputs. CS429 Slideset 5: 16

Bit Equality The following circuit generates a 1 iff a and b are equal. int eq = (a&&b) (!a&&!b); Can you design a simpler circuit to do this? Hardware description languages (Verilog, VHDL) Describe control, data movement,... Compile (synthesize) a hardware description into a circuit. CS429 Slideset 5: 17

Verilog Example One of the more widely used HDL s is Verilog: module simp circuit (A, B, C, x, y) ; input A, B, C; output x, y; wire e; and g1 (e, A, B) ; not g2 (y, C) ; or g3 (x, e, y) ; endmodule CS429 Slideset 5: 18

HCL Hardware Control Language (HCL) Very simple hardware description language. Boolean operations have syntax similar to C logical operations. We ll use it to describe control logic for processors. Data types bool: Boolean ( a, b, c,... ) int: words ( A, B, C,... ) Does not specify word size Statements bool a = bool-expr; int A = int-expr; CS429 Slideset 5: 19

HCL Operations Boolean expressions Logic operations: a && b, a b,!a Word comparisons: A == B, A!= B, A < B, A <= B, A >= B, A > B Set membership: A in {B, C, D} Word expressions Case expressions: [a: A; b: B; c: C] Evaluate Boolean expressions a, b, c in sequence Return corresponding word expression for first successful Boolean evaluation. CS429 Slideset 5: 20

Word Equality Word-level representation: b31 a31 Bit equal eq31 A B = Eq b30 Bit equal eq30 a30 HCL Representation: b1 a1 b0 a0...... Eq eq1 Bit equal eq0 Bit equal Eq = (A == B) Assume 32-bit word size. HCL representation Equality operation Generates Boolean value CS429 Slideset 5: 21

Bit Multiplexor S b Out a HCL Expression: int out = (s && a) (!s && b); Control signal s selects between two inputs a and b. Output is a when s == 1, and b otherwise. CS429 Slideset 5: 22

Word Multiplexor Word-level representation: S S A b31 out31 B Mux Out a31... HCL Representation: b0 out0 int Out = [ s : A; 1 : B; ]; a0 Select input word A or B depending on control signal S. CS429 Slideset 5: 23

Word Examples C B A Minimum of 3 words MIN3 Min3 int Min3 = [ A <= B && A <= C : A; B <= A && B <= C : B; 1 : C; ] S1 S0 D0 D1 D2 D3 4 way Multiplexor MUX4 Out4 int Out4 = [!s1 &&!s0 : D0;!s1 : D1;!s0 : D2; 1 : D3; ] What do these do? CS429 Slideset 5: 24

Constructing an ALU An ALU is an Arithmetic Logic Unit Multiple functions: add, subtract, and, xor, others Combinational logic to perform functions. Control signals select function to be performed. Modular: multiple instances of 1-bit ALU CS429 Slideset 5: 25

A 4-bit ALU Combinational logic: continuously responding to inputs. Control signal selects function computed; Y86 ALU has only 4 arithmetic/logical operations. Also computes values of condition codes. Note these are not the same as the three Y86 flags: OF: overflow flag ZF: zero flag SF: sign flag CS429 Slideset 5: 26

The Y86 ALU in HCL <s1,s0>=00 <s1,s0>=01 <s1,s0>=10 <s1,s0>=11 X Y A L U OF ZF SF X X X A A A X+Y L X Y L L X&Y X^Y U U U Y OF ZF SF Y OF ZF SF Y OF ZF SF int Out = [!s1 &&!s0: X+Y;!s1 && s0 : X-Y; s1 &&!s0: X&Y; 1 : X^Y; ]; CS429 Slideset 5: 27

Sequential Logic How would you design a circuit that records a bit? What does that even mean? CS429 Slideset 5: 28

Sequential Logic How would you design a circuit that records a bit? What does that even mean? Ideally, you d like a device (latch) as follows: Data Enable 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 000000 111111 Q The value on line Q is the current stored value. To store a new value: 1 Line Enable should be low (0). 2 Place the bit to store on line Data. 3 Raise Enable to high (1). 4 The value on line Data is stored in the device. 5 Lower Enable to low (0). 6 Reading Q returns the stored bit until next store. Such state-holding devices are called sequential logic as opposed to combinational logic. CS429 Slideset 5: 29

SR Flip Flop: Storing a Bit An SR flip flop is a step in the direction of a latch. Pulse the R (reset) input to record a 0. Pulse the S (set) input to record a 1. Characteristic table S R Qnext Action 0 0 Q hold state 0 1 0 reset 1 0 1 set 1 1 X not allowed CS429 Slideset 5: 30

Gated D Latch: Store and Accesss One Bit D CP Q _ Q Higher level representation D Latch Truth table E/CP D Q Q Comment 0 X Q Q No change 1 0 0 1 Reset 1 1 1 0 Set E (enable) and CP (clock pulse) are just two names for the same input. CS429 Slideset 5: 31

A 4-bit Register D0 D Q Q0 CP _ Q 4 D latches: D1 D Q Q1 All share the E (aka WE or Write Enable) input CP _ Q D0 D3 are the data input Q0 Q3 are the output D2 D CP Q _ Q Q2 D3 D Q Q3 CP CP _ Q CS429 Slideset 5: 32

Register File Abstraction Register file provides the CPU with temporary, fast storage. N registers. Each of K bits. L output ports. Suppose we want eight 4-bit registers and one output port. Data in /4 Reg /3 WE /1 Data out /4 CS429 Slideset 5: 33

Race-Through Condition with D Latches Write Enable (WE) must be held at 1 long enough to allow: Data to be read; Operation (e.g., addition) to be performed; Result to be stored in target register. Register File ALU CS429 Slideset 5: 34

Edge Triggered Flip Flops An edge-triggered flip-flop changes states either at the positive edge (rising edge) or at the negative edge (falling edge) of the clock pulse on the control input. A register is made up of several flip flops, each providing storage and access for an individual bit. A register file is made up of several registers and control logic CS429 Slideset 5: 35

Clocking The clock acts to enforce timing control on the chip. An integral part of every synchronous system. Can be global Clock Frequency = 1 / clock period Measured in cycles per second (Hertz) 1 KHz = 1000 cycles / second 1ns (10 9 seconds) = 1GHz (10 9 ) clock frequency Higher frequency means faster machine speed. CS429 Slideset 5: 36

Random Access Memory (RAM) Stores many words Conceptually, a large array where each row is uniquely addressable. In reality, much more complex to increase throughput. Multiple chips and banks, interleaved, with multi-word operations. Many implementations Dynamic (DRAM) is large, inexpensive, but relatively slow. 1 transistor and 1 capacitor per bit. Reads are destructive. Requires periodic refresh. Access time takes hundreds of CPU cycles. Static (SRAM) is fast but expensive. 6 transistors per bit. Streaming orientation. CS429 Slideset 5: 37

Summary Computation Performed by combinational logic. Implements boolean functions. Continuously reacts to inputs. Storage Registers: part of the CPU. Each holds a single word. Used for temporary results of computation. Loaded on rising clock. Memory is much larger. Variety of implementation techniques. CS429 Slideset 5: 38