CS140 Lecture 03: The Machinery of Computation: Combinational Logic

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

Lecture #21 March 31, 2004 Introduction to Gates and Circuits

Music. Numbers correspond to course weeks EULA ESE150 Spring click OK Based on slides DeHon 1. !

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 09 MULTIPLEXERS

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

Arithmetic-logic units

Binary Adders: Half Adders and Full Adders

CS/COE 0447 Example Problems for Exam 2 Spring 2011

QUESTION BANK FOR TEST

COS 116 The Computational Universe Laboratory 7: Digital Logic I

COMP combinational logic 1 Jan. 18, 2016

(Refer Slide Time 6:48)

CSC 220: Computer Organization Unit 10 Arithmetic-logic units

Basic Arithmetic (adding and subtracting)

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

CS 261 Fall Mike Lam, Professor. Combinational Circuits

Let s put together a Manual Processor

How a Digital Binary Adder Operates

CO Computer Architecture and Programming Languages CAPL. Lecture 9

GC03 Boolean Algebra

CS 31: Introduction to Computer Systems. 03: Binary Arithmetic January 29

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

Lecture 21: Combinational Circuits. Integrated Circuits. Integrated Circuits, cont. Integrated Circuits Combinational Circuits

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

Week 6: Processor Components

Digital Systems. John SUM Institute of Technology Management National Chung Hsing University Taichung, ROC. December 6, 2012

EXPERIMENT #8: BINARY ARITHMETIC OPERATIONS

(Refer Slide Time 3:31)

CS 31: Intro to Systems Binary Arithmetic. Kevin Webb Swarthmore College January 26, 2016

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

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

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

UC Berkeley College of Engineering, EECS Department CS61C: Combinational Logic Blocks

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

Software and Hardware

Arithmetic Circuits. Design of Digital Circuits 2014 Srdjan Capkun Frank K. Gürkaynak.

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

Continuing with whatever we saw in the previous lectures, we are going to discuss or continue to discuss the hardwired logic design.

Boolean Analysis of Logic Circuits

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

EET 1131 Lab #7 Arithmetic Circuits

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

Experiment 7 Arithmetic Circuits Design and Implementation

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

Computer Organization and Levels of Abstraction

CS101 Lecture 04: Binary Arithmetic

CPU Architecture system clock

Boolean Arithmetic. From Nand to Tetris Building a Modern Computer from First Principles. Chapter 2

CS429: Computer Organization and Architecture

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

Digital Logic Design Exercises. Assignment 1

Digital Logic Design (3)

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

Systems Programming. Lecture 2 Review of Computer Architecture I

Dr. Chuck Cartledge. 10 June 2015

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

Digital Circuits. Page 1 of 5. I. Before coming to lab. II. Learning Objectives. III. Materials

Chapter 2: Universal Building Blocks. CS105: Great Insights in Computer Science

E40M. Binary Numbers, Codes. M. Horowitz, J. Plummer, R. Howe 1

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

EE292: Fundamentals of ECE

Computer Organization and Levels of Abstraction

ELCT201: DIGITAL LOGIC DESIGN

11.1. Unit 11. Adders & Arithmetic Circuits

discrete logic do not

ENGIN 112 Intro to Electrical and Computer Engineering

Segment 1A. Introduction to Microcomputer and Microprocessor

Introduction to Computer Science. Homework 1

Combinational Logic Use the Boolean Algebra and the minimization techniques to design useful circuits No feedback, no memory Just n inputs, m outputs

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

structure syntax different levels of abstraction

Here is a list of lecture objectives. They are provided for you to reflect on what you are supposed to learn, rather than an introduction to this

CS 31: Intro to Systems Caching. Martin Gagne Swarthmore College March 23, 2017

DIGITAL ARITHMETIC: OPERATIONS AND CIRCUITS

Chapter Three. Digital Components

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

CS 261 Fall Mike Lam, Professor. Logic Gates

Lecture 10: Combinational Circuits

ELEC 326: Class project

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

Review. Steps to writing (stateless) circuits: Create a logic function (one per output)

Topics. Midterm Finish Chapter 7

Sorting: Overview/Questions

CS 101, Mock Computer Architecture

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

Basic circuit analysis and design. Circuit analysis. Write algebraic expressions or make a truth table

637 has a 1 s place, 10 s place and 100 s place Show how to go from *256+7* =

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

Signed umbers. Sign/Magnitude otation

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

Submitted by 1

Concept of Memory. The memory of computer is broadly categories into two categories:

Arithmetic Logic Unit (ALU)

Computer Architecture Set Four. Arithmetic

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION

Microcomputers. Outline. Number Systems and Digital Logic Review

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

UNIT 6 CIRCUIT DESIGN

DIGITAL CIRCUIT LOGIC UNIT 7: MULTI-LEVEL GATE CIRCUITS NAND AND NOR GATES

Digital Logic the Bare Minimum

Transcription:

CS140 Lecture 03: The Machinery of Computation: Combinational Logic John Magee 25 January 2017 Some material copyright Jones and Bartlett Some slides credit Aaron Stevens 1

Overview/Questions What did we do last time? Can we relate this circuit stuff to something we know something about? How can we combine these elements to do more complicated tasks? By combining several gates, we create logiccomputing circuits. Logic-computing circuits can do binary number addition. 2

What did we talk about last time? Circuits control the flow of electricity. Gates are simple logical systems. 3

Integrated Circuits Integrated circuit (also called a chip) A piece of silicon on which multiple (many) gates have been embedded. Silicon pieces are mounted on a plastic or ceramic package with pins along the edges that can be soldered onto circuit boards or inserted into appropriate sockets 4

Integrated Circuits 5

Central Processor Units The most important integrated circuit in any computer is the Central Processing Unit, or CPU. The Intel Duo Core 2 processor has more than 1.9 billion (1.9 * 10 9 ) gate transistors on one chip. The CPU combines many gates, to enable a small number of instructions. Examples: Add/subtract 2 binary inputs Load a value from memory Store a value into memory 6

Combinational Circuits Combines some basic gates (AND, OR, XOR, NOT) into a more complex circuit. Outputs from one circuit flow into the inputs of another circuit. The input values explicitly determine the output values. 7

Combinational Circuits Three inputs require eight rows to describe all possible input combinations (2 3 = 8): This same circuit using a Boolean expression is (AB + AC) 8

Recall Binary Number Addition Adding two 1-bit numbers together produces A sum bit A carry bit 9

Binary Number Addition Look closely at the values for Sum and Carry Do they look like any of the gates we ve seen? 10

A Circuit for Binary Addition Sum = A XOR B Carry = A AND B This circuit is called a half-adder. (It doesn t take a carry-in.) 11

Full Adder Circuit The full adder takes 3 inputs: A, B, and a carry-in value Figure 4.10 A full adder 12

Recall Binary Number Addition Adding two 1-bit numbers together produces A sum bit A carry bit http://www.cs.bu.edu/courses/cs101/labs/ecs_2e/applets/applets/binaryadd/applet_frame.htm 13

The Full Adder Here is the Full Adder, with its internal details hidden (an abstraction). What matters now are: inputs are A, B, and CI. outputs are S and CO 14

An 8-bit Adder To add two 8-bit numbers together, we need an 8-bit adder: Notice how the carry out from one bit s adder becomes the carry-in to the next adder. 15

An 8-bit Adder We can abstract away the 1-bit adders, And summarize with this diagram: Notice the inputs and outputs. 16

Output from the Adder The adder produces 2 outputs: Sum (multi-bit), Carry Out (1-bit) Where does the output go from here? Accumulator A circuit connected to an adder, which stores the adder s result. 17

Putting it Together The accumulator is a memory circuit, and is wired as both an output from the adder and an input back into the adder. 18

Accumulator Example Suppose we want to add 3 numbers: 1) Clear the accumulator (set to all 0s) 2) Load the first input into the adder 3) Compute the sum of accumulator + input 4) Result flows back into accumulator 5) Go to step 2 with next input 19

Input to the Adder The adder takes inputs A, B are two binary numbers (Carry-in should be 0) Our nand2tetris adder will be slightly different How do we feed numbers into the adder? Random Access Memory A large memory unit which stores data before/after processing. 20

What about Subtraction? 2s complement Recall that binary subtraction is accomplished by adding the 2s complement of a number. Inverter A circuit built using NOT gates, which inverts all bits turning 1s into 0s and 0s into 1s. The inverter creates a 1s complement of its input. Adding 1 to this gives a 2s complement number, suitable for doing subtraction. (How could we add 1 to the inverted number?) 21

What about Subtraction? In nand2tetris world: Note that x y = (-x + y) Since we don t need to store intermediate results, this can be done in 1 s complement: - Flip the bits of x (this computes x in 1 s complement) - Add y - Flip the bits of the result 22

From Adding Machine What we ve got is an machine that can do addition/subtraction in circuitry. It can read data from memory, and write data back to memory. We haven t dealt with how to: Specify from which address memory to read. Specify which operation to perform (add/subtract). Specify to which address to write. 23

Take-Away Points Combination gates Half-Adder Full Adder Adder Inverter Accumulator 24