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.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

ADDER, HALF ADDER & FULL ADDER
Tutorial: Wednesday Week 3 Hand in on Monday, Do the questions for tutorials 1 & 2 at the back of the course notes (answers to tutorial 3 will be published.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
08/07/041 CSE-221 Digital Logic Design (DLD) Lecture-8:
Fall 2005 L15: Combinational Circuits Lecture 15: Combinational Circuits Complete logic functions Some combinational logic functions –Half adders –Adders.
Chapter 4 Gates and Circuits.
9/19/06 Hofstra University – Overview of Computer Science, CSC005 1 Chapter 4 Gates and Circuits.
The Analytical Engine Hardware. The Logic Machine Computers were originally wired to perform a specific task. The vision was a machine that could perform.
Part 2: DESIGN CIRCUIT. LOGIC CIRCUIT DESIGN x y z F F = x + y’z x y z F Truth Table Boolean Function.
Building Adders & Sub tractors Dr Ahmed Telba. Introducing adder circuits Adder circuits are essential inside microprocessors as part of the ALU, or arithmetic.
CS 105 Digital Logic Design
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Chapter 4 Gates and Circuits.
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
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. 
Binary Numbers.
Chapter 4 Gates and Circuits. Integrated Circuits aka CHIPS What’s in this thing???? 4–2.
Chapter 4 Gates and Circuits.
Binary Addition CSC 103 September 17, 2007.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Logic Gates. Transistors as Switches ¡EB voltage controls whether the transistor conducts in a common base configuraiton. ¡Logic circuits can be built.
Basic Arithmetic (adding and subtracting)
CPS120: Introduction to Computer Science
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Basic Arithmetic (adding and subtracting)
Module 9.  Digital logic circuits can be categorized based on the nature of their inputs either: Combinational logic circuit It consists of logic gates.
Digital Electronics and Computer Interfacing
Lecture 9 Topics: –Combinational circuits Basic concepts Examples of typical combinational circuits –Half-adder –Full-adder –Ripple-Carry adder –Decoder.
Logic Gates Logic gates are electronic digital circuit perform logic functions. Commonly expected logic functions are already having the corresponding.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
4. Computer Maths and Logic 4.2 Boolean Logic Logic Circuits.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 8 Arithmetic.
Universal college of engineering & technology. .By Harsh Patel)
How computers calculate How binary operations yield complex capabilities.
CS 1308 – Computer Literacy and the Internet Building the CPU.
1 GCSE Computing Binary Logic. GCSE Computing 2 Candidates should be able to understand and produce simple logic diagrams using the operations NOT, AND,
Logic Design CS221 1 st Term combinational circuits Cairo University Faculty of Computers and Information.
Introduction to Computing Systems and Programming Digital Logic Structures.
Chapter 3 Digital Logic Structures
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
Digital electronics 4–1 Gates and Circuits SANJAYBHAI RAJGURU COLLEGE OF ENGG.
Logic Gates and Boolean Algebra Introduction to Logic II.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Winter 2016CISC101 - Prof. McLeod1 Today Take some of the “MAGIC” out of how computers work: How did the technology get to where it is today? –ENIAC movie.
1 Review of Boolean algebra Not is a horizontal bar above the number –0 = 1 –1 = 0 Or is a plus –0+0 = 0 –0+1 = 1 –1+0 = 1 –1+1 = 1 And is multiplication.
Logic Gates Learning Objectives Learn that there is a one-to-one relationship between logic gates and Boolean expressions Learn how logic gates are combined.
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Invitation to Computer Science, C++ Version, Fourth Edition
Dr.Ahmed Bayoumi Dr.Shady Elmashad
Circuits Logic in Hardware.
CS140 Lecture 03: The Machinery of Computation: Combinational Logic
Fundamentals & Ethics of Information Systems IS 201
XOR, XNOR, and Binary Adders
Invitation to Computer Science, Java Version, Third Edition
Chapter 4 Gates and Circuits.
CS105 Introduction to Computer Concepts GATES and CIRCUITS
CISC101 Reminders Your group name in onQ is your grader’s name.
XOR, XNOR, & Binary Adders
Number Systems Decimal (base 10) { }
Boolean Algebra.
Week 7: Gates and Circuits: PART II
Logic Gates.
Logic Gates.
XOR, XNOR, and Binary Adders
CISC101 Reminders Course Web Site:
XOR Function Logic Symbol  Description  Truth Table 
XOR, XNOR, and Binary Adders
Presentation transcript:

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. Creating an “N Bit Adder”.

Winter 2016CISC101 - Prof. McLeod2 Transistors - Cont. Source, Gate and Drain are also called “Collector”, “Base” and “Emitter”: A 5V signal applied to the gate or “base” is enough to cause current to flow. Zero volts turns the signal off. Combinations of transistors can be used to perform boolean logical functions, called “gates”:

Winter 2016CISC101 - Prof. McLeod3 “AND” Gate Two transistors forming an “AND” gate: Both Input-1 and Input-2 have to be “1” (ie. 5 volts) for the Output to be “on”. How an “AND” gate is drawn in a logic diagram: Logic or “Truth” table:

Winter 2016CISC101 - Prof. McLeod4 “OR” Gate Either Input-1 or Input-2 can cause Output to be “On”. An “OR” gate in a logic diagram.

Winter 2016CISC101 - Prof. McLeod5 “NOT” Gate The “NOT” gate just reverses the Input:

Winter 2016CISC101 - Prof. McLeod6 “NOR” Gate Same as NOT(OR), like an OR gate followed by a NOT gate.

Winter 2016CISC101 - Prof. McLeod7 “NAND” Gate Same as NOT(AND), like an AND gate followed by a NOT gate.

Winter 2016CISC101 - Prof. McLeod8 “XOR” Gate X Y Z=X  Y XOR gate (These are NOT(AND) or “NAND” gates.) One way:

CISC101 - Prof. McLeod9 Summary: “Truth” or Logic Tables AND I1I1 I2I2 Output OR I1I1 I2I2 Output NOT I Output NAND I1I1 I2I2 Output NOR I1I1 I2I2 Output XOR I1I1 I2I2 Output

CISC101 - Prof. McLeod10 Summary, Cont. Gates: You can use transistors to build a circuit, or “gate”, that provides the logic for each of these operators. Notation: a  b (you will also see just “ab”) means “a AND b” a+b means “ a OR b” a means NOT(a) a  b means “a XOR b” Winter 2016

CISC101 - Prof. McLeod11 Digital Circuits Generally, a digital circuit can be represented by: Remember that an input or output can only be either on (1) or off (0). The gates defined above can be used to design circuits that provide a desired logic. Winter 2016

CISC101 - Prof. McLeod12 For Example: Adding Binary Numbers Show how to build a circuit to add binary numbers - a “one bit full adder”. First: How do you add decimal (base 10) numbers?: Carry digits Sum + Winter 2016

CISC101 - Prof. McLeod13 Adding Binary Numbers, for Example The binary numeric system consists of zeros and ones – only. Also called “base 2”. Adding binary numbers: Carry bits Sum + Winter 2016

CISC101 - Prof. McLeod14 Half Bit Adder Look at the first column of the process: carry output input 1 input 2 sum output Winter 2016

CISC101 - Prof. McLeod15 Half Bit Adder - Cont. Construct a truth table to describe the operation, considering every possible input: input 1input 2sum outputcarry output Which gate produces the sum? The carry? Winter 2016

CISC101 - Prof. McLeod16 Write the boolean expressions for the sum output and the carry output: Where “ S ” is the sum output and “ C o ” is the carry output. Half Bit Adder - Cont. or Winter 2016

CISC101 - Prof. McLeod17 Half Bit Adder - Cont. Logical diagram for the sum output: (This is another way to build a “XOR” gate.) notand or Winter 2016

CISC101 - Prof. McLeod18 Test XOR Gate Logic notand or Winter 2016

CISC101 - Prof. McLeod19 Test XOR Gate, Cont. notand or Winter 2016

CISC101 - Prof. McLeod20 Half Bit Adder - Cont. Back to the expression for “ S ”: So, S can be generated by an “XOR” gate and C o by an “AND” gate: I1I1 I2I2 S CoCo Winter 2016

CISC101 - Prof. McLeod21 Full Bit Adder Look at one column of the addition process that also adds the carry bit: carry output carry input input 1 input 2 sum output Winter 2016

CISC101 - Prof. McLeod22 Full Bit Adder - Cont. Construct a logic table to describe what happens - list every input possibility: carry inputinput 1input 2sum outputcarry output Winter 2016

CISC101 - Prof. McLeod23 Full Bit Adder - Cont. Create boolean expressions: Where “ I ” is input, “ C i ” is carry input, “ C o ” is carry output and “ S ” is sum output. (Don’t panic! You don’t have to know where these expressions come from and you don’t have to remember them!) Winter 2016

CISC101 - Prof. McLeod24 Full Bit Adder - Cont. You can write the logical diagram from these expressions as they are but it can be simplified using two “half-bit” adders and an OR gate: S CoCo I1I1 I2I2 CiCi Winter 2016

CISC101 - Prof. McLeod25 Full Bit Adder - Cont. How many transistors required? –AND and OR have 2 each, NOT has 1 (and a resistor) –Then XOR must have 8 (2 NOTs, 2 ANDs, 1 OR) –Half-bit adder must have 10 (1 XOR, 1 AND) –Full-bit adder must have 22 (2 half-bits, 1 OR) Winter 2016

CISC101 - Prof. McLeod26 N Bit Full Adder Winter 2016

CISC101 - Prof. McLeod27 N Bit Full Adder – Cont. How many transistors? –22 times N –Integers might occupy 4 bytes or 32 bits for example: 704 transistors, minimum! –Just to add two integers! Winter 2016

YouTube Video Another presentation of this topic that might help: Winter 2016CISC101 - Prof. McLeod28

Aside - Minecraft Constructions People with a lot of time on their hands have built adders like these in Minecraft. For example, see these YouTube videos: One bit: 32 bit: CISC101 - Prof. McLeod29Winter 2016

CISC101 - Prof. McLeod30 Other Operations So, a full adder can be used to produce a N+1-bit number as the sum of two other N bit numbers. How about multiplication? From Grade 4: 27   Base 10: Base 2: Winter 2016

CISC101 - Prof. McLeod31 Multiplication, Cont. So what kind of logic would you build to do multiplication of x times y? Create a running sum, s. For each digit, x i : If x i equals 1 then add 2 i  y to x. Use a bitwise shift operation to calculate 2 i  y (ie. Add a zero to the right of the number). So, an N-bit adder would be used along with some other simple circuits. Winter 2016

CISC101 - Prof. McLeod32 Summary of Digital Logic The CPU needs to carry out many other operations than just addition: –subtraction –comparison –multiplication –division, etc. Some common functions (trig, exp, log, etc) would work faster if they were hard coded into the processor too. Lots (and lots!) of transistors!! Winter 2016

Aside – My CPU, for Example Intel Core i7 2670QM, 2.2 GHz (up to 3.2 GHz): –32 nm technology –6MB cache –4 cores, 8 threads –995 million transistors, total. –988 pins. CISC101 - Prof. McLeod33Winter 2016

CISC101 - Prof. McLeod34 “Don’t Worry, Be Happy!” You do not need to be able to design microprocessor circuits! Besides, INTEL and AMD have some fancy programs that do all the work. The purpose of this discussion has been to give you some idea of how an integrated circuit carries out instructions. (Not MAGIC! Just some good technology!) Winter 2016