CS 31: Intro to Systems Digital Logic

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

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

Parallel logic circuits

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

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Logic Design (Part 2) Combinational Logic Circuits (Chapter 3)

Building a Virtual Computer

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

Lecture Topics. Announcements. Today: Integer Arithmetic (P&H ) Next: continued. Consulting hours. Introduction to Sim. Milestone #1 (due 1/26)

ALU Design. 1-bit Full Adder 4-bit Arithmetic circuits. Arithmetic and Logic Unit Flags. Add/Subtract/Increament/Decrement Circuit

COSC 243. Computer Architecture 1. COSC 243 (Computer Architecture) Lecture 6 - Computer Architecture 1 1

CS429: Computer Organization and Architecture

Dec Hex Bin ORG ; ZERO. Introduction To Computing

Revision: August 31, E Main Suite D Pullman, WA (509) Voice and Fax

REGISTER TRANSFER LANGUAGE

The MIPS Processor Datapath

Instructions. Philipp Koehn. 16 February 2018

Stack. Heap. Static. Code

Computer Organization and Levels of Abstraction

CHAPTER 4: Register Transfer Language and Microoperations

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

CS 24: INTRODUCTION TO. Spring 2015 Lecture 2 COMPUTING SYSTEMS

Chapter 4. The Processor

Good Evening! Welcome!

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

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

ECE260: Fundamentals of Computer Engineering

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

Von Neumann Architecture

REGISTER TRANSFER AND MICROOPERATIONS

Computer Organization and Levels of Abstraction

CS101 Lecture 25: The Machinery of Computation: Computer Architecture. John Magee 29 July 2013 Some material copyright Jones and Bartlett

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017

CS 261 Fall Mike Lam, Professor. Combinational Circuits

COMPUTER ORGANIZATION AND DESIGN

Register Transfer Language and Microoperations (Part 2)

11.1. Unit 11. Adders & Arithmetic Circuits

Microcomputers. Outline. Number Systems and Digital Logic Review

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

REGISTER TRANSFER AND MICROOPERATIONS

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

Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

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

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University


Fundamentals of Computer Systems

Reference Sheet for C112 Hardware

Id Question Microprocessor is the example of architecture. A Princeton B Von Neumann C Rockwell D Harvard Answer A Marks 1 Unit 1

For Example: P: LOAD 5 R0. The command given here is used to load a data 5 to the register R0.

16.1. Unit 16. Computer Organization Design of a Simple Processor

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Chapter 4 The Processor 1. Chapter 4A. The Processor

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Real Digital Problem Set #6

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

Digital Logic Design Exercises. Assignment 1

Level 2: The Hardware World Chapters 4 and 5 (topics of other cs courses)

Chapter 4. The Processor

Levels in Processor Design

Introduction to Computer Science. Homework 1

Software and Hardware

EE 3170 Microcontroller Applications

Computer Organization (Autonomous)

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

CS61C : Machine Structures

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Register Transfer and Micro-operations

Chapter 7. Storage Components

ELCT 501: Digital System Design

UNIT-III REGISTER TRANSFER LANGUAGE AND DESIGN OF CONTROL UNIT

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

Computer Hardware Engineering

CPU ARCHITECTURE. QUESTION 1 Explain how the width of the data bus and system clock speed affect the performance of a computer system.

Digital Design with FPGAs. By Neeraj Kulkarni

Basic Processing Unit: Some Fundamental Concepts, Execution of a. Complete Instruction, Multiple Bus Organization, Hard-wired Control,

Digital Fundamentals. Lab 6 2 s Complement / Digital Calculator

CC411: Introduction To Microprocessors

Chapter 4. The Processor Designing the datapath

Microcomputer Architecture and Programming

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Let s put together a Manual Processor

Processor (I) - datapath & control. Hwansoo Han

Systems Architecture

ECE 341 Midterm Exam

Computer Architecture. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

COSC 122 Computer Fluency. Computer Organization. Dr. Ramon Lawrence University of British Columbia Okanagan

Note that none of the above MAY be a VALID ANSWER.

Many ways to build logic out of MOSFETs

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

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Introduction to Computing Module No: CS/ES/1 Quadrant 1 e-text

Arithmetic Logic Unit. Digital Computer Design

CS 105 Review Questions #3

MICROPROGRAMMED CONTROL

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

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

Digital Logic the Bare Minimum

CS 2630 Computer Organization. Meeting 13: Faster arithmetic and more operations Brandon Myers University of Iowa

Transcription:

CS 3: Intro to Systems Digital Logic Martin Gagné Swarthmore College January 3, 27 You re going to want scratch papr today borrow some if needed.

Quick nnouncements Late Policy Reminder 3 late days total for the whole semester Lab work Start early, especially multi-week labs Readings Only the page linked, no further links

Today (and Thursday) Hardware basics Machine memory models Digital signals Logic gates Manipulating/Representing values in hardware dders Storage & memory (latches)

The system stack c program compiler software shell operating system Starting this week This class memory CPU hardware circuits gates transistors electrical engineering wires

Hardware Models (94 s) Harvard rchitecture: Program Memory CPU (Control and rithmetic) Data Memory Input/Output Von Neumann rchitecture: CPU (Control and rithmetic) Input/Output Program and Data Memory

Von Neumann rchitecture Model Computer is a generic computing machine: ased on lan Turing s Universal Turing Machine

Von Neumann rchitecture Model Computer is a generic computing machine: ased on lan Turing s Universal Turing Machine The hardware only ever executes one program: Initialize program counter Repeat forever: { fetch instruction indicated by program counter increment the program counter execute the instruction }

Von Neumann rchitecture Model Computer is a generic computing machine: ased on lan Turing s Universal Turing Machine Stored program model: computer stores program rather than encoding it (feed in data and instructions) No distinction between data and instructions memory 5 parts connected by buses (wires): Memory, Control, Processing, Input, Output Memory Cntrl Unit Processing Unit Input/Output addr bus cntrl bus data bus

Memory Stores instructions and data. ddressable, like array indices. addr,, 2, (In CPU:) Memory ddress Register: address to read/write Memory Data Register: value to read/write Memory Cntrl Unit Processing Unit Input/Output addr bus cntrl bus data bus

Central Processing Unit (CPU) Processing Unit: executes instructions selected by the control unit LU (arithmetic logic unit): simple functional units: DD, SU, ND, OR, etc. Registers: temporary storage directly accessible by instructions Control unit: determines the order in which instructions execute PC: program counter: address of next instruction IR: instruction register: holds current instruction clock-based control: clock signal+ir trigger state changes

Input/Output Keyboard Files on the hard drive Network communication Memory Cntrl Unit Processing Unit Input/Output addr bus cntrl bus data bus

Digital Computers ll input is discrete (driven by periodic clock) ll signals are binary (: no voltage, : voltage) data, instructions, control signals, arithmetic, clock To run program, need different types of circuits Circuits to execute program instructions that act on program data CPU LU, Cntrl, Storage RM Cntrl & Storage bus Circuits to store program data and instructions and support reading and writing addressable storage locations

Goal: uild a CPU (model) Three main classifications of HW circuits:. LU: implement arithmetic & logic functionality (ex) adder to add two values together 2. Storage: to store binary values (ex) Register File: set of CPU registers, lso: main memory (RM) 3. Control: support/coordinate instruction execution (ex) fetch the next instruction to execute

bstraction User / Programmer Wants low complexity pplications Specific functionality Software library Reusable functionality Operating system Manage resources Complex devices Compute & I/O

bstraction Hardware Circuits Logic Gates Transistors Complex devices Compute & I/O Here be dragons. (Electrical Engineering) (Physics)

Logic Gates Input: oolean value(s) (high and low voltages for and ) Output: oolean value result of boolean function lways present, but may change when input changes Not Or nd a a out b out = a & b out b out = a b & a out out = ~a ~

More Logic Gates Note the circle on the output. This means negate it. NND NOR a a out b out = ~(a & b) out b out = ~(a b) NND NOR

Combinational Logic Circuits uild up higher level processor functionality from basic gates cyclic Network of Gates Inputs Outputs Outputs are boolean functions of inputs Outputs continuously respond to changes to inputs

What does this circuit output? Not Or nd X Output Y Clicker Choices X Y Out Out OutC OutD OutE

What can we do with these? uild-up XOR from basic gates (ND, OR, NOT) ^ Q: When is ^ ==?

Which of these is an XOR circuit? nd Or Not Draw an XOR circuit using ND, OR, and NOT gates. I ll show you the clicker options after you ve had some time.

Which of these is an XOR circuit? : : C: D: E: None of these are XOR.

Checking the XOR circuit ^ == (~ & ) ( & ~) : : ^: : : ^: out = ^ : : ^: : : ^:

bstracting the XOR circuit ^ == (~ & ) ( & ~) out = ^ = XOR out = ^ ^

Digital Circuits - uilding a CPU Three main classifications of HW circuits:. LU: implement arithmetic & logic functionality (ex) adder to add two values together 2. Storage: to store binary values (ex) Register File: set of CPU registers 3. Control: support/coordinate instruction execution (ex) fetch the next instruction to execute HW Circuits Logic Gates Transistor

Digital Circuits - uilding a CPU Three main classifications of HW circuits:. LU: implement arithmetic & logic functionality (ex) adder to add two values together Start with LU components (e.g., adder, logic circuits) Combine (with multiplexer) into LU! HW Circuits Logic Gates Transistor

rithmetic Circuits bit adder: + Two outputs:. Obvious one: the sum 2. Other one:?? Cout Sum(+)

Which of these circuits is a one-bit adder? Sum(+) : Sum Cout : Sum Cout Cout C: D: Sum Cout Sum Cout

More than one bit? When adding, sometimes have carry in too +

One-bit (full) adder Need to include: Carry-in & Carry-out Cin Sum Cout Cin = -bit adder Cout Sum

One-bit (full) adder Need to include: Carry-in & Carry-out cin Cin Sum Cin cout H Cout cout cout sum H sum = -bit adder Cout Sum

Multi-bit dder (Ripple-carry dder) -bit adder Sum 3 3 Cout -bit adder -bit adder Cout Sum3 Cout Sum Cout 2 2 -bit adder N- N- Sum2 -bit adder Cout SumN-

Three-bit dder (Ripple-carry dder) (2) + (3) Carry in -bit adder -bit adder -bit adder = 2 2 3-bit adder Carry out Sum Sum Sum2

rithmetic Logic Unit (LU) One component that knows how to manipulate bits in multiple ways ddition Subtraction Multiplication / Division itwise ND, OR, NOT, etc. uilt by combining components Take advantage of sharing HW when possible (e.g., subtraction using adder)

Simple 3-bit LU: dd and bitwise OR 3-bit inputs and : 2 Sum Sum Sum2 3-bit adder 2 Or Or Or2 t any given time, we only want the output from ONE of these!

Simple 3-bit LU: dd and bitwise OR Extra input: control signal to select Sum vs. OR 3-bit inputs and : 2 Sum Sum Sum2 3-bit adder 2 Or Or Or2 Circuit that takes in Sum-2 / Or-2 and only outputs one of them, based on control signal.

Which of these circuits lets us select between two inputs? Input : Input Control Signal Input 2 Control Signal Input 2 Input Control Signal Input 2 C: :

Multiplexor: Chooses an input value Inputs: 2N data inputs, N signal bits Output: is one of the 2N input values s bit 2-way MUX b a out out = (s & a) (~s &b) Control signal s, chooses the input for output When s is : choose a, when s is : choose b

Word Multiplexor s s b3 Input: two 32 bit values (a, b) one bit signal s out3 Each corresponding bit of 32 bit input values, fed through bit mux a3 Output: b Out out3 a3 b3 MUX out One 32 bit value (either a or b) a 38

N-Way Multiplexor Choose one of N inputs, need log2 N select bits s 4-Way Multiplexor s s D D3 choose D D D2 D3 s s D D2 s S Input to choose D Out MUX4 D.........

Simple 3-bit LU: dd and bitwise OR Extra input: control signal to select Sum vs. OR 3-bit inputs and : 2 Sum Sum Sum2 3-bit adder 2 Or Or Or2 Multiplexer!

LU: rithmetic Logic Unit CPU Instruction: DD 2 op bits: selects which op to output 3 Y X L U X op Y OF Output flags: set as a side effect of op (e.g., overflow detected) rithmetic and logic circuits: DD, SU, NOT, Control circuits: use op bits to select output Circuits around LU: Select input values X and Y from instruction or register Select op bits from instruction to feed into LU Feed output somewhere

Up next More digital circuits (storage and control)