CS 1308 – Computer Literacy and the Internet Building the CPU.

Slides:



Advertisements
Similar presentations
Part 4: combinational devices
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
Chapter 1 — Computer Abstractions and Technology — 1 Lecture 7 Carry look ahead adders, Latches, Flip-flops, registers, multiplexors, decoders Digital.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Invitation to Computer Science, C++ Version, Third Edition
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
The Logic Machine We looked at programming at the high level and at the low level. The question now is: How can a physical computer be built to run a program?
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third & Fourth Edition Spring 2008:
Building Computer Circuits Chapter 4.4. CMPUT101 Introduction to Computing(c) Yngvi Bjornsson2 Purpose We have looked at so far how to build logic gates.
Chapter 4 Gates and Circuits.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
16/07/2015CSE1303 Part B lecture notes 1 Hardware Implementation Lecture B17 Lecture notes section B17.
CHAPTER 4 CS BUILDING BLOCKS: BINARY NUMBERS, BOOLEAN LOGIC, GATES.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Binary System and Logical Gates
CPSC 171 Introduction to Computer Science Boolean Logic, Gates, & Circuits.
CS 1308 – Computer Literacy and the Internet. It’s Not Magic  The goal of the next series of lectures is to show you exactly how a computer works. 
Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part.
Chapter 4 Gates and Circuits. Integrated Circuits aka CHIPS What’s in this thing???? 4–2.
Chapter 4 The Building Blocks: Binary Numbers, Boolean Logic, and Gates.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
CSCI-235 Micro-Computers in Science Hardware Design Part I.
Basic Arithmetic (adding and subtracting)
Invitation to Computer Science 5th Edition
Chapter 5: Computer Systems Organization Invitation to Computer Science, Java Version, Third Edition.
Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Roadmap Problems Algorithms.
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Introduction to Digital Logic and Circuits EE 101, Fall 2015 University of Kentucky.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /10/2013 Lecture 5: Combinational Logic Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE.
Invitation to Computer Science 6th Edition Chapter 4 The Building Blocks: Binary Numbers, Boolean Logic, and Gates.
1 Arithmetic Logic Unit ALU. 2 The Bus Concept 3 CPU Building Blocks  Registers (IR, PC, ACC)  Control Unit (CU)  Arithmetic Logic Unit (ALU)
Computer Science 101 Circuit Design - Examples. Sum of Products Algorithm Identify each row of the output that has a 1. Identify each row of the output.
CSCI-100 Introduction to Computing Hardware Design Part I.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
CDA 3101 Fall 2013 Introduction to Computer Organization The Arithmetic Logic Unit (ALU) and MIPS ALU Support 20 September 2013.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science,
CPS3340 Computer Architecture Fall Semester, 2013
Computer Science 101 More Devices: Arithmetic. From 1-Bit Equality to N-Bit Equality = A B A = B Two bit strings.
CS/COE0447 Computer Organization & Assembly Language
Logic Design / Processor and Control Units Tony Diep.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Appendix C Basics of Digital Logic Part I. Florida A & M University - Department of Computer and Information Sciences Modern Computer Digital electronics.
The Central Processing Unit (CPU)
Arithmetic Logic Unit (ALU) Introduction to Computer Yung-Yu Chuang with slides by Sedgewick & Wayne ( introcs.cs.princeton.edu ), Nisan & Schocken (
LECTURE 4 Logic Design. LOGIC DESIGN We already know that the language of the machine is binary – that is, sequences of 1’s and 0’s. But why is this?
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Winter 2016CISC101 - Prof. McLeod1 Today How transistors can carry out commands in a CPU. For example, how to add two integers in an integrated circuit.
Invitation to Computer Science, C++ Version, Fourth Edition
Prof. Sin-Min Lee Department of Computer Science
More Devices: Control (Making Choices)
CSCI-100 Introduction to Computing
Fundamentals & Ethics of Information Systems IS 201
Invitation to Computer Science, Java Version, Third Edition
Invitation to Computer Science, C++ Version, Third Edition
Computer Science 210 Computer Organization
Fundamentals of Computer Science Part i2
The Building Blocks: Binary Numbers, Boolean Logic, and Gates
Invitation to Computer Science 6th Edition
Digital Logic.
Chapter 5: Computer Systems Organization
Digital Logic.
COMS 361 Computer Organization
Combinational Circuits
Digital Circuits and Logic
Presentation transcript:

CS 1308 – Computer Literacy and the Internet Building the CPU

It’s Not Magic The goal of the next series of lectures is to show you exactly how a computer works. We will discuss the logic used to create computer instructions and how the computer decides which instructions to execute. Although at times it may appear to be magical. It’s just math and science. 2

Our Picture of a Computer Data Bus memory input/ output control unit arithmetic- logic unit Central Processing Unit (CPU) registers

The Reliability of Binary Representation 4 Electronic devices are most reliable in a bistable environment Bistable environment Distinguishing only two electronic states Current flowing or not Direction of flow Computers are bistable: hence binary representations

A Switch is a 2-state device that can be toggled 5 A relay is a switch built with an electromagnet controlled current controlling current when the controlling current is 1, the electromagnet pulls the switch closed, and the controlled current flows through the switch

Switches can do it all 6 With switches we can implement AND, OR, and NOT gates With just those types of gates, we can design circuits to perform any computation Remember, computers do very simple tasks, very quickly

Basic electric circuits: Computing AND CS Computer Fluency 7 in1 in2 out truth table for AND } when both inputs are 1, the circuit is closed and in1 in2 out = in1 in2 out power source in1 in2

Basic electric circuits: Computing OR 8 in1 in2 out truth table for OR } in1 in2 out or = in1 + in2 out in1 in2 when either input is 1, the circuit is closed

Basic electric circuits: Computing NOT 9 in1 out truth table for NOT } A new type of switch which is closed at rest in1 out = in1’ not out in1

A better switch: Transistors 10 bi-stable, solid state device switching is done electronically, not mechanically no moving parts; therefore, fast, small, reliable can switch states in about one 10 billionth of a second about 5 million transistors can fit on a chip 1 centimeter square. Density is increasing rapidly with new technology.

Figure 4.11 Simplified Model of a Transistor CS Computer Fluency 11

Boolean Logic and Gates: Boolean Logic 12 Boolean logic describes operations on true/false values True/false maps easily onto bistable environment Boolean logic operations on electronic signals may be built out of transistors and other electronic devices

Boolean Logic (continued) 13 Boolean expressions Constructed by combining together Boolean operations Example: (a AND b) OR ((NOT b) AND (NOT a)) Truth tables capture the output/value of a Boolean expression A column for each input plus the output A row for each combination of input values

Boolean Logic (continued) 14 Example: (a AND b) OR ((NOT b) and (NOT a)) abValue

Building Computer Circuits: Introduction 15 A circuit is a collection of logic gates: Transforms a set of binary inputs into a set of binary outputs Values of the outputs depend only on the current values of the inputs Combinational circuits have no cycles in them (no outputs feed back into their own inputs)

A Compare-for-equality Circuit 16 Compare-for-equality circuit CE compares two unsigned binary integers for equality Built by combining together 1-bit comparison circuits (1-CE) Integers are equal if corresponding bits are equal (AND together 1-CD circuits for each pair of bits)

A Compare-for-equality Circuit (continued) 17 1-CE circuit truth table abOutput

Figure 4.22 One-Bit Compare for Equality Circuit CS Computer Fluency 18

A Compare-for-equality Circuit (continued) 19 1-CE Boolean expression First case: (NOT a) AND (NOT b) Second case: a AND b Combined: ((NOT a) AND (NOT b)) OR (a AND b)

Figure 4.19 Diagram of a Typical Computer Circuit CS Computer Fluency 20

A Circuit Construction Algorithm 21 Sum-of-products algorithm Truth table captures every input/output possible for circuit Repeat process for each output line Build a Boolean expression using AND and NOT for each 1 of the output line Combine together all the expressions with ORs Build circuit from whole Boolean expression

Examples Of Circuit Design And Construction 22 Compare-for-equality circuit Addition circuit Both circuits can be built using the sum-of-products algorithm

An Addition Circuit 23 Addition circuit Adds two unsigned binary integers, setting output bits and an overflow Built from 1-bit adders (1-ADD) Starting with rightmost bits, each pair produces A value for that order A carry bit for next place to the left

An Addition Circuit (continued) 24 1-ADD truth table Input One bit from each input integer One carry bit (always zero for rightmost bit) Output One bit for output place value One “carry” bit

Figure 4.24 The 1-ADD Circuit and Truth Table 25

An Addition Circuit (continued) 26 Building the full adder Put rightmost bits into 1-ADD, with zero for the input carry Send 1-ADD’s output value to output, and put its carry value as input to 1-ADD for next bits to left Repeat process for all bits

Computer Instructions The logic for every instruction is executed on every cycle by the Arithmetic and Logic Unit (ALU). The answer used is the one for the instruction that is currently decoded and executed by the CPU. This selection is done by the Control Circuits. 27

Control Circuits 28 Do not perform computations Choose order of operations or select among data values Major types of controls circuits Multiplexors Select one of inputs to send to output Decoders Sends a 1 on one output line, based on what input line indicates

Control Circuits (continued) 29 Multiplexor form 2 N regular input lines N selector input lines 1 output line Multiplexor purpose Given a code number for some input, selects that input to pass along to its output Used to choose the right input value to send to a computational circuit

Figure 4.28 A Two-Input Multiplexor Circuit 30

Control Circuits (continued) 31 Decoder Form N input lines (typically the size of the BUS) 2 N output lines N input lines indicate a binary number, which is used to select one of the output lines Selected output sends a 1, all others send 0

Control Circuits (continued) 32 Decoder purpose Given a number code for some operation, trigger just that operation to take place Numbers might be codes for arithmetic: add, subtract, etc. Decoder signals which operation takes place next

Figure 4.29 A 2-to-4 Decoder Circuit 33

Summary 34 Binary values create a bistable environment, making computers reliable Boolean logic maps easily onto electronic hardware Circuits are constructed using Boolean expressions as an abstraction Computational and control circuits may be built from Boolean gates