l What have discussed up until now & why: l C Programming language l More low-level then Java. l Better idea about what s really going on.

Similar documents
Gates, Circuits, and Boolean Algebra

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

BOOLEAN ALGEBRA & LOGIC GATES

Chapter 2 Logic Gates and Introduction to Computer Architecture

CHAPTER 3 Boolean Algebra and Digital Logic

Karnaugh Maps. Circuit-wise, this leads to a minimal two-level implementation

Lecture 12: More on Registers, Multiplexers, Decoders, Comparators and Wot- Nots

Combinational circuits

Gates & Boolean Algebra. Boolean Operators. Combinational Logic. Introduction

Digital Electronics Detailed Outline

Two-level logic using NAND gates

CSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps

Simplifying Logic Circuits with Karnaugh Maps

COMBINATIONAL CIRCUITS

2.0 Chapter Overview. 2.1 Boolean Algebra

Combinational Logic Design

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

3.Basic Gate Combinations

earlier in the semester: The Full adder above adds two bits and the output is at the end. So if we do this eight times, we would have an 8-bit adder.

EE360: Digital Design I Course Syllabus

CSE140: Components and Design Techniques for Digital Systems

Lecture 8: Synchronous Digital Systems

United States Naval Academy Electrical and Computer Engineering Department. EC262 Exam 1

DEPARTMENT OF INFORMATION TECHNLOGY

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

RAM & ROM Based Digital Design. ECE 152A Winter 2012

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, Lab 2. The Full-Adder

Let s put together a Manual Processor

Karnaugh Maps & Combinational Logic Design. ECE 152A Winter 2012

RUTGERS UNIVERSITY Department of Electrical and Computer Engineering 14:332:233 DIGITAL LOGIC DESIGN LABORATORY

CSE140 Homework #7 - Solution

Figure 8-1 Four Possible Results of Adding Two Bits

ELEC EXPERIMENT 1 Basic Digital Logic Circuits

Basic Logic Gates Richard E. Haskell

Understanding Logic Design

CSE140: Midterm 1 Solution and Rubric

Digital circuits make up all computers and computer systems. The operation of digital circuits is based on

Logic in Computer Science: Logic Gates

Read-only memory Implementing logic with ROM Programmable logic devices Implementing logic with PLDs Static hazards

exclusive-or and Binary Adder R eouven Elbaz reouven@uwaterloo.ca Office room: DC3576

Chapter 4 Register Transfer and Microoperations. Section 4.1 Register Transfer Language

Lecture 5: Gate Logic Logic Optimization

Binary Adders: Half Adders and Full Adders

List of Experiment. 8. To study and verify the BCD to Seven Segments DECODER.(IC-7447).

Upon completion of unit 1.1, students will be able to

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

ECE410 Design Project Spring 2008 Design and Characterization of a CMOS 8-bit Microprocessor Data Path

Design and Development of Virtual Instrument (VI) Modules for an Introductory Digital Logic Course

Systems I: Computer Organization and Architecture

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

Asynchronous Counters. Asynchronous Counters

Lab 1: Study of Gates & Flip-flops

FORDHAM UNIVERSITY CISC Dept. of Computer and Info. Science Spring, The Binary Adder

Systems I: Computer Organization and Architecture

CMOS Binary Full Adder

Flip-Flops, Registers, Counters, and a Simple Processor

A single register, called the accumulator, stores the. operand before the operation, and stores the result. Add y # add y from memory to the acc

Module 4 : Propagation Delays in MOS Lecture 22 : Logical Effort Calculation of few Basic Logic Circuits

SECTION C [short essay] [Not to exceed 120 words, Answer any SIX questions. Each question carries FOUR marks] 6 x 4=24 marks

Karnaugh Maps (K-map) Alternate representation of a truth table

Binary full adder. 2-bit ripple-carry adder. CSE 370 Spring 2006 Introduction to Digital Design Lecture 12: Adders

5 Combinatorial Components. 5.0 Full adder. Full subtractor

Lab 1: Full Adder 0.0

Memory Elements. Combinational logic cannot remember

Counters are sequential circuits which "count" through a specific state sequence.

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

CS 61C: Great Ideas in Computer Architecture Finite State Machines. Machine Interpreta4on

The components. E3: Digital electronics. Goals:

C H A P T E R. Logic Circuits

Operating Manual Ver.1.1

Module 3: Floyd, Digital Fundamental

Programming Logic controllers

ANALOG & DIGITAL ELECTRONICS

A Course Material on DIGITAL PRINCIPLES AND SYSTEM DESIGN

BINARY CODED DECIMAL: B.C.D.

Using Logic to Design Computer Components

Gray Code Generator and Decoder by Carsten Kristiansen Napier University. November 2004

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

ENGI 241 Experiment 5 Basic Logic Gates

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Course Requirements & Evaluation Methods

Copyright Peter R. Rony All rights reserved.

CHAPTER 11: Flip Flops

Sistemas Digitais I LESI - 2º ano

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

The string of digits in the binary number system represents the quantity

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

Counters and Decoders

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

CSE140: Components and Design Techniques for Digital Systems. Introduction. Prof. Tajana Simunic Rosing

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

Here we introduced (1) basic circuit for logic and (2)recent nano-devices, and presented (3) some practical issues on nano-devices.

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

ECE124 Digital Circuits and Systems Page 1

Combinational Logic Design Process

Digital Logic Elements, Clock, and Memory Elements

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Transcription:

CS211 Computer Architecture l Topics Digital Logic l Transistors (Design & Types) l Logic Gates l Combinational Circuits l K-Maps Class Checkpoint l What have discussed up until now & why: l C Programming language l More low-level then Java. l Better idea about what s really going on. l Covered data representation l Computers manipulate data. How is this data stored and manipulated? l Covered Machine-Level representation of programs (assembly lanaguage - x86) l Computers don t work on C code (or Java). Need instructions closer to hardware. l What s next? Processor Design how does machine instructions actually make the processor work? Figures & Tables borrowed from:! http://www.allaboutcircuits.com/vol_4/index.html! But first l Before we go into processor design, we re going to cover some topics in Digital Logic. l Book covers this only sparingly, we re going to go into a bit more detail. l Specifically: l Transistors l Logic gates l Combinational & Sequential Circuits l Flip-Flops l Memory Transistor: Building Block of Computers l Microprocessors contain millions of transistors l Intel Pentium 4 (2000): 48 million l IBM PowerPC 750FX (2002): 38 million l IBM/Apple PowerPC G5 (2003): 58 million l Logically, each transistor acts as a switch l Combined to implement logic functions l AND, OR, NOT l Combined to build higher-level structures l Adder, multiplexer, decoder, register, l Combined to build processor 1

Simple Switch Circuit n-type MOS Transistor l Switch open: l No current through circuit l Light is off l V out is +2.9V l Switch closed: l Short circuit across switch l Current flows l Light is on l V out is 0V Switch-based circuits can easily represent two states: on/off, open/closed, voltage/no voltage. l MOS = Metal Oxide Semiconductor l two types: n-type and p-type l n-type l when Gate has positive voltage, short circuit between #1 and #2 (switch closed) l when Gate has zero voltage, open circuit between #1 and #2 (switch open) Terminal #2 must be connected to GND (0V). Gate = 1 Gate = 0 p-type MOS Transistor l p-type is complementary to n-type l when Gate has positive voltage, open circuit between #1 and #2 (switch open) l when Gate has zero voltage, short circuit between #1 and #2 (switch closed) Gate = 1 Inverter (NOT Gate) Truth table In Out In Out Gate = 0 0 V 2.9 V 2.9 V 0 V 0 1 1 0 Terminal #1 must be connected to +2.9V. 2

NOR Gate OR Gate A B C 0 0 0 0 1 1 1 0 1 1 1 1 Note: Serial structure on top, parallel on bottom. A B C 0 0 1 0 1 0 1 0 0 1 1 0 Add inverter to NOR. NAND Gate (NOT(AND)) AND Gate A B C 0 0 0 0 1 0 1 0 0 1 1 1 Note: Parallel structure on top, serial on bottom. A B C 0 0 1 0 1 1 1 0 1 1 1 0 Add inverter to NAND. 3

Basic Logic Gates Symbols XOR: truth table A^B A B 0 0 0 0 1 1 1 0 1 1 1 0 A XOR B + XOR A O + B - - A^B= A & B + A&B DeMorgan's Law l NOT (A and B) = NOT (A) OR NOT (B) l NOT (A OR B) = NOT(A) AND NOT (B) A BB NOT(A AND B) NOT (A) NOT (B) 0 0 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 1 0 0 0 0 NOT(A) OR NOT(B) DeMorgan's Law l Converting AND to OR (with some help from NOT) l Consider the following gate: To convert AND to OR (or vice versa), invert inputs and output. A B A B A B A B 0 0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 Same as A OR B 4

More than 2 Inputs? l AND/OR can take any number of inputs. l AND = 1 if all inputs are 1. l OR = 1 if any input is 1. l Similar for NAND/NOR. l Can implement with multiple two-input gates, or with single CMOS circuit. Building Functions from Logic Gates l Combinational Logic Circuit l output depends only on the current inputs l stateless l Sequential Logic Circuit l output depends on the sequence of inputs (past and present) l stores information (state) from past inputs l We'll first look at some useful combinational circuits, then show how to use sequential circuits to store information. Half adder l A half adder is used to add just two bits. l The result consists of two bits: a sum (the right bit) and a carry out (the left bit) S l Here is the circuit and its block symbol X Y CS 0 + 0 = 00 0 + 1 = 01 1 + 0 = 01 1 + 1 = 10 C Full Adder l Add two bits and carry-in, produce one-bit sum and carry-out. A B C in S C out 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 1 1 1 1 1 5

Four-bit Adder (carry-ripple adder) Carry Save adder l Compute Sum and Carry independently l 101 101 l 101 101 l ------ ---------- l 000 101- Disadvantage: Delay through N-1 Stages l Then add S + C 000 l 101- l ---------------- l 1010 Carry Save adder l Delay reduced compared to Carry ripple adder l Add 3 Numbers and Produce two numbers S and C X: Y: Z: C: 1 0 0 1 1 + 1 1 0 0 1 + 0 1 0 1 1 1 1 0 1 1 l Final result is S + shifted carry X: Y: Z: 1 0 0 1 1 + 1 1 0 0 1 + 0 1 0 1 1 S: 0 0 0 0 1 C: 1 1 0 1 1 Sum: 1 1 0 1 1 1 X: Y: Z: S: 1 0 0 1 1 + 1 1 0 0 1 + 0 1 0 1 1 0 0 0 0 1 Carry Save Adder Design X Y Z CSA n+1 n C=carry S=sum + X X n-1 Y n-1 Z n-1 n-2 Y n-2 X Z n-2 0 Y 0 Z 0 FA FA FA C n S C n-1 C 1 n-1 S n-2 S 0 N Bit Carry Save Adder Block C 0 =0 6

Decoder l n inputs, 2 n outputs l exactly one output is 1 for each possible input pattern Decoder l n inputs, 2 n outputs l exactly one output is 1 for each 0 possible input pattern 2-bit decoder 2-bit decoder 1 2 3 Selecting Memory Multiplexer (MUX) A0.. A7 256 x 8 RAM 256 x 8 RAM 256 x 8 RAM 256 x 8 RAM l n-bit selector and 2 n inputs, one output l output equals one of the inputs, depending on selector A8 A9 2 to 4 decoder 4-to-1 MUX 7

Circuit Design Converting Truth Table to Boolean Expression l Designing circuits is a process 1. Have a good idea. What kind of circuit might be useful? 2. Derive a truth table for this circuit. 3. Derive a Boolean expression for the truth table. 4. Build a circuit given the Boolean expression l l Building the circuit involves mapping the Boolean expression to actual gates. This part is easy. Deriving the Boolean expression is easy. Deriving a good one is tricky. l Given a circuit, isolate that rows in which the output of the circuit should be true. Converting Truth Table to Boolean Expression Converting Truth Table to Boolean Expression l Given a circuit, isolate that rows in which the output of the circuit should be true. l A product term that contains exactly one instance of every variable is called a minterm. l Given the expressions for each row, build a larger Boolean expression for the entire table. l This is a sum-of-products (SOP) form. 8

Converting Truth Table to Boolean Expression First Approach: Algebraic l Simply use the rules of Boolean logic l Finally build the circuit. l Problem: SOP forms are often not minimal. l Solution: Make it minimal. We ll go over two ways. The Result Karnaugh Maps or K-Maps l K-maps are a graphical technique to view minterms and how they relate. l The map is a diagram made up of squares, with each square representing a single minterm. l Minterms resulting in a 1 are marked as 1, all others are marked 0 9

2 Variable K-Map 2 Variable K-Map 2 Variable K-Map Finding Commonality 0 0 1 1 10

Finding the best solution Simplify Example l Grouping become simplified products. l Both are correct. A+B is preferred. Simplify Example 3 Variable K-Maps C l Note in higher maps, several variables occupy a given axis l The sequence of 1s and 0s follow a Gray Code Sequence. B 11

3 Variable K-Maps 3 Variable K-Maps C B 3 Variable K-Maps 3 Variable K-Maps 12

3 Variable K-Maps Back to our earlier example.. l The K-map and the algebraic produce the same result. Up up and let s D keep going Few more examples D A C B A B C 13

Few more examples D A B C 14