Lecture 12 Logic Design Review & HCL & Bomb Lab

Slides:



Advertisements
Similar presentations
Give qualifications of instructors: DAP
Advertisements

Computer Science 210 Computer Organization Clocks and Memory Elements.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /23/2013 Lecture 7: Computer Clock & Memory Elements Instructor: Ashraf Yaseen DEPARTMENT OF MATH &
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
David O’Hallaron Carnegie Mellon University Processor Architecture Logic Design Processor Architecture Logic Design
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
CS 300 – Lecture 3 Intro to Computer Architecture / Assembly Language Sequential Circuits.
1  1998 Morgan Kaufmann Publishers Chapter Five The Processor: Datapath and Control.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Chapter Five The Processor: Datapath and Control.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
CS:APP CS:APP Chapter 4 Computer Architecture Control Logic and Hardware Control Language CS:APP Chapter 4 Computer Architecture Control Logic and Hardware.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
HCL and ALU תרגול 10. Overview of Logic Design Fundamental Hardware Requirements – Communication: How to get values from one place to another – Computation.
Chapter 2Basic Digital Logic1 Chapter 2. Basic Digital Logic2 Outlines  Basic Digital Logic Gates  Two types of digital logic circuits Combinational.
1 Seoul National University Logic Design. 2 Overview of Logic Design Seoul National University Fundamental Hardware Requirements  Computation  Storage.
Computer Architecture Lecture 4 Sequential Circuits Ralph Grishman September 2015 NYU.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
Randal E. Bryant Carnegie Mellon University CS:APP CS:APP Chapter 4 Computer Architecture SequentialImplementation CS:APP Chapter 4 Computer Architecture.
Datapath Design I Topics Sequential instruction execution cycle Instruction mapping to hardware Instruction decoding Systems I.
Computer Architecture Carnegie Mellon University
1 Sequential CPU Implementation. 2 Outline Logic design Organizing Processing into Stages SEQ timing Suggested Reading 4.2,4.3.1 ~
CS:APP3e CS:APP Chapter 4 Computer Architecture Logic Design CS:APP Chapter 4 Computer Architecture Logic Design CENG331 - Computer Organization Murat.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
1 Processor Architecture. 2 Topics Write Y86 code Basic Logic design Hardware Control Language HCL Suggested Reading: 4.1, 4.2.
May 9, 2001Systems Architecture I1 Systems Architecture I (CS ) Lab 5: Introduction to VHDL Jeremy R. Johnson May 9, 2001.
Lecture 23: 11/26/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
May 22, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 14: A Simple Implementation of MIPS * Jeremy R. Johnson Mon. May 17, 2000.
Abstraction. Not real, not concrete A view that is removed from the reality Definitely has a "base" in reality – the "base" may be non-intuitive and not.
Appendix C Basics of Logic Design. Appendix C — Logic Basic — 2 Logic Design Basics §4.2 Logic Design Conventions Objective: To understand how to build.
Mohamed Younis CMCS 411, Computer Architecture 1 CMSC Computer Architecture Lecture 8 Hardware Design Languages February 21, 2001
Computer Science 210 Computer Organization
Computers’ Basic Organization
Computer Architecture & Operations I
CS161 – Design and Architecture of Computer Systems
Computer Architecture & Operations I
Computer Organization and Architecture + Networks
Control & Execution Finite State Machines for Control MIPS Execution.
Computer Architecture & Operations I
Seoul National University
Basics of digital systems
Morgan Kaufmann Publishers
Overview Instruction Codes Computer Registers Computer Instructions
Computer Science 210 Computer Organization
Processor (I).
Latches and Flip-flops
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Computer Science 210 Computer Organization
CSCE Fall 2013 Prof. Jennifer L. Welch.
Levels in Processor Design
Introduction to Computer System
The Processor Lecture 3.1: Introduction & Logic Design Conventions
Registers.
Recap: Performance Comparison
COMS 361 Computer Organization
Levels in Processor Design
CSCE Fall 2012 Prof. Jennifer L. Welch.
Computer Architecture
Levels in Processor Design
Control units In the last lecture, we introduced the basic structure of a control unit, and translated our assembly instructions into a binary representation.
ECE 352 Digital System Fundamentals
Sequential Logic.
Levels in Processor Design
Introduction to Computer System
Computer Systems An Introducton.
Introduction to the Architecture of Computers
What You Will Learn In Next Few Sets of Lectures
Presentation transcript:

Lecture 12 Logic Design Review & HCL & Bomb Lab CSCE 212 Computer Architecture Lecture 12 Logic Design Review & HCL & Bomb Lab Topics 211 review Comparators Multiplexors decoders Hardware Control Language (HCL) Architecture Lab March 14, 2017

Today Bomblab Bombserver matthewsCM = 129.252.11.236:15213 Logic design review Hardware Description languages Like a program except specifies hardware component Verilog VHDL CSAPP version -- Hardware Control Language (HCL)

Aggregate data - Arrays double a[53][62]; … sum = 0.0 for i for j sum = sum + a[i][j] Today is Pi –day Finding pi in unix locate pi /usr/include/math.h

Structures and Unions; Arrays of Structures struct student{ int id; double gpa; char * name; struct student *link; } union unode{ … struct student roll[57]; struct student r145[14][24];

Combinational Circuits Acyclic Network Primary Inputs Outputs Acyclic Network of Logic Gates Continously responds to changes on primary inputs Primary outputs become (after some delay) Boolean functions of primary inputs

Bit Equality Bit equal HCL Expression bool eq = (a&&b)||(!a&&!b) Generate 1 if a and b are equal 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

Word Equality Word-Level Representation B Eq = A HCL Representation Bit equal a63 eq63 b62 a62 eq62 b1 a1 eq1 b0 a0 eq0 Eq = B A Eq HCL Representation bool Eq = (A == B) 64-bit word size HCL representation Equality operation Generates Boolean value

Decoders – n x 2n decoder

Bit-Level Multiplexor s Bit MUX HCL Expression bool out = (s&&a)||(!s&&b) b out a Control signal s Data signals a and b Output a when s=1, b when s=0

Word Multiplexor Word-Level Representation HCL Representation b63 s a63 out63 b62 a62 out62 b0 a0 out0 s B A Out MUX HCL Representation int Out = [ s : A; 1 : B; ]; Select input word A or B depending on control signal s HCL representation Case expression Series of test : value pairs Output value for first successful test

HCL Word-Level Examples Minimum of 3 Words Find minimum of three input words HCL case expression Final case guarantees match int Min3 = [ A < B && A < C : A; B < A && B < C : B; 1 : C; ]; A Min3 MIN3 B C 4-Way Multiplexor D0 D3 Out4 s0 s1 MUX4 D2 D1 Select one of 4 inputs based on two control bits HCL case expression Simplify tests by assuming sequential matching int Out4 = [ !s1&&!s0: D0; !s1 : D1; !s0 : D2; 1 : D3; ];

Arithmetic Logic Unit Combinational logic Y X X + Y A L U Y X X - Y 1 A L U Y X X & Y 2 A L U Y X X ^ Y 3 A B A B A B A B OF ZF CF OF ZF CF OF ZF CF OF ZF CF Combinational logic Continuously responding to inputs Control signal selects function computed Corresponding to 4 arithmetic/logical operations in Y86-64 Also computes values for condition codes

Storing and Accessing 1 Bit Bistable Element Q+ Q– q !q q = 0 or 1 Q+ Q– R S R-S Latch Resetting 1 Setting 1 Storing !q q

1-Bit Latch D Latch Q+ Q– R S D C Latching Storing 1 d !d d !d q !q Data Clock Latching 1 d !d Storing d !d q !q

Transparent 1-Bit Latch Latching 1 d !d C D Q+ Time Changing D When in latching mode, combinational propogation from D to Q+ and Q– Value latched depends on value of D as C falls

Edge-Triggered Latch D R Q+ Q– C S T Data Q+ Q– C S T Clock Trigger C D Q+ Time T Only in latching mode for brief period Rising clock edge Value latched depends on data as clock rises Output remains stable at all other times

Registers Structure i7 i6 i5 i4 i3 i2 i1 i0 o7 o6 o5 o4 o3 o2 o1 o0 D C Q+ i7 i6 i5 i4 i3 i2 i1 i0 o7 o6 o5 o4 o3 o2 o1 o0 Clock I O Clock Stores word of data Different from program registers seen in assembly code Collection of edge-triggered latches Loads input on rising edge of clock

Register Operation   State = x State = y Output = y Rising clock Input = y Output = x Stores data bits For most of time acts as barrier between input and output As clock rises, loads input

State Machine Example Comb. Logic Out In Clock Accumulator circuit Out MUX 1 Clock In Load Accumulator circuit Load or accumulate on each cycle x0 x1 x2 x3 x4 x5 x0+x1 x0+x1+x2 x3+x4 x3+x4+x5 Clock Load In Out

Random-Access Memory Stores multiple words of memory Register file A B W dstW srcA valA srcB valB valW Read ports Write port Clock Stores multiple words of memory Address input specifies which word to read or write Register file Holds values of program registers %rax, %rsp, etc. Register identifier serves as address ID 15 (0xF) implies no read or write performed Multiple Ports Can read and/or write multiple words in one cycle Each has separate address and data input/output

Register File Timing   2 2 2 Rising y clock 2 Reading Writing Like combinational logic Output data generated based on input address After some delay Writing Like register Update only as clock rises Register file A B srcA valA srcB valB 2 x x 2 y 2 Register file W dstW valW Clock x  Register file W dstW valW Clock y 2 Rising clock 

Hardware Control Language Very simple hardware description language Can only express limited aspects of hardware operation Parts we want to explore and modify Data Types bool: Boolean a, b, c, … int: words A, B, C, … Does not specify word size---bytes, 64-bit words, … Statements bool a = bool-expr ; int A = int-expr ;

HCL Operations Boolean Expressions Word Expressions Classify by type of value returned 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 } Same as A == B || A == C || A == D Word Expressions Case expressions [ a : A; b : B; c : C ] Evaluate test expressions a, b, c, … in sequence Return word expression A, B, C, … for first successful test

Summary Computation Storage Performed by combinational logic Computes Boolean functions Continuously reacts to input changes Storage Registers Hold single words Loaded as clock rises Random-access memories Hold multiple words Possible multiple read or write ports Read word when address input changes Write word as clock rises