Number Representation and Logic Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from.

Slides:



Advertisements
Similar presentations
Lab 10 : Arithmetic Systems : Adder System Layout: Slide #2 Slide #3 Slide #4 Slide #5 Arithmetic Overflow: 2’s Complement Conversions: 8 Bit Adder/Subtractor.
Advertisements

LOGIC GATES ADDERS FLIP-FLOPS REGISTERS Digital Electronics Mark Neil - Microprocessor Course 1.
EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
Logic Circuits Another look at Floating Point Numbers Common Combinational Logic Circuits Timing Sequential Circuits Note: Multiplication & Division in.
2-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Fundamentals of Digital.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Assembly Language and Computer Architecture Using C++ and Java
Major Numeric Data Types Unsigned Integers Signed Integers Alphanumeric Data – ASCII & UNICODE Floating Point Numbers.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Digital Circuits. Analog and Digital Signals Noise margins in Logic Circuits VMVM.
Computer ArchitectureFall 2008 © August 20 th, Introduction to Computer Architecture Lecture 2 – Digital Logic Design.
TDC 311 Digital Logic. Truth Tables  AND  OR  NOT  NAND  NOR  XOR  XNOR.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Chapter 1 The Big Picture. QUIZ 2 5 Explain the abstractions we normally apply when using the following systems: DVD player Registering for classes on.
Binary, Decimal, & Hexadecimal Numbers
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Binary Numbers.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Basic Arithmetic (adding and subtracting)
ELE22MIC Lecture 3 Paul Main’s Office Location has moved to Pysical Sciences 2 Room 107 Will be available for 2 hours consultation 10am - 12am after Tuesday.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Concepts of Engineering and Technology Copyright © Texas Education Agency, All rights reserved.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Logic Circuits I.
Basic Arithmetic (adding and subtracting)
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
CPU Internal memory I/O interface circuit System bus
Number Representation. Representing numbers n Numbers are represented as successive powers of a base, or radix.
ECEN 248 Lab 4: Multiplexer Based Arithmetic Logic Unit
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
מבנה מחשב תרגול 2. 2 Boolean AND Operation Truth Table Equivalent Gate Different notations:
Digital Logic. 2 Abstractions in CS (gates) Basic Gate: Inverter IO IO GNDI O Vcc Resister (limits conductivity) Truth Table.
Basic Electricity and Electronics Module Two Basic Electronics Copyright © Texas Education Agency, All rights reserved.
By Jariya Phongsai A two's-complement system is a system in which negative numbers are represented by the two's complement of the absolute value; this.
Lecture 18: Hardware for Arithmetic Today’s topic –Intro to Boolean functions (Continued) –Designing an ALU 1.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Digital Representations ME 4611 Binary Representation Only two states (0 and 1) Easy to implement electronically %0= (0) 10 %1= (1) 10 %10= (2) 10 %11=
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
1. Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 2.
CO5023 Introduction to Digital Circuits. What do we know so far? How to represent numbers (integers and floating point) in binary How to convert between.
Registers and Binary Arithmetic Prof. Sirer CS 316 Cornell University.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Number Representation and Arithmetic Circuits
Circuit Optimization CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic.
1 Ethics of Computing MONT 113G, Spring 2012 Session 4 Binary Addition.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 1.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Basic Electricity and Electronics Module Two Basic Electronics Copyright © Texas Education Agency, All rights reserved.
1 CS/COE0447 Computer Organization & Assembly Language Logic Design Appendix C.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
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.
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
Chapter 3 - Binary Numbering System
ECE 3130 Digital Electronics and Design
Digital Logic and Computer Organization
Instructor: Alexander Stoytchev
Fundamentals & Ethics of Information Systems IS 201
An Introduction to Microprocessors
CS/COE0447 Computer Organization & Assembly Language
Number Systems Decimal (base 10) { }
Numbers and Arithmetic
Digital Logic.
Digital Logic.
ECE 352 Digital System Fundamentals
CSC3050 – Computer Architecture
An Introduction to Microprocessors
Presentation transcript:

Number Representation and Logic Design CS 3220 Fall 2014 Hadi Esmaeilzadeh Georgia Institute of Technology Some slides adopted from Prof. Milos Prvulovic

Computing with digital technology  Physical Layer – Low voltage (0 V) – High voltage (5 V, then 3.3 V, 1.1 V, and now is 0.9 V or lower)  Abstraction (we do not deal with voltage levels) – ‘0’ – ‘1’  Groups of binary values construct words, numbers, pixels, audio signals, … 2

What does this binary value represent? = 0100_ _ _ _1001 3

What does this binary value represent? = 0100_ _ _ _1001 Hadi … 4

Terminology  Physical: – Bit: one binary digit  Abstract: – Nibble: four binary digits – Byte: eight binary digits = two nibbles – Word: Usually 32 binary digits = 4 bytes 5

Number Representation  Positional notation Same as base-10 but now it’s base 2: – In base 10, we have 9807 = 9* * * *10 0 – In base 2, we have 1011 = 6

Signed numbers  Easy: one bit for sign, then absolute value – E.g (- 011) is actually -3  How do we add two such numbers? – First check the sign bits – If both are 1 or both 0, add the absolute values and retain the same sign bit – If one is 1 and one is 0, compare the two absolute values, then subtract the smaller from the larger and use the sign of the larger number  Lots of circuitry needed for all this!  Also we have to representation for zero: (-0, +0)  We need a better way! 7

Two’s complement  OK, let’s say we want 4-bit signed numbers but – Want to just add the numbers as if they were unsigned – Want to quickly tell if number is positive or negative  So if we add 1 to -1 we should get 0 – 0 is 0000, 1 is 0001, so -1 has to be 1111  Now, if we add 1 to -2, we should get -1 – So -2 has to be 1110  We can still tell if positive or negative  But add, subtract, etc. is much simpler now 8

Two’s complement 9 What is the range?

Two’s complement  Quickly negate a 2’s number: – 1011 – Invert(all bits) + ‘1’ – Start from right, copy until the first ‘1’, then invert the remaining  Sign extension: – Store 1011 in a byte 10

Note on Number Representation  Digital logic still operates on binary signals  2’s complement vs. sign-and-value is all about how we choose to represent numbers using the underlying binary signals  If four wires have values of 1, 0, 1, 1, then – If sign-and-value, it represents -3 – If 2’s complement, it is -5 – If unsigned number, it is 11 (eleven) – May not even be a number! 11

Hexadecimal Notation  Writing binary numbers is inconvenient – More than 3 times as many digit as decimal notation  So we also use hexadecimal (base 16) notation – Fewer digits needed than in binary (or even decimal) – Each hex digit represents exactly 4 binary digits, so it is easy to convert back-and-forth – Example: Hexadecimal E04C is in binary:  Note: no actual “hexadecimal” hardware – Hardware still operates in binary – Hexadecimal notation is only for our convenience 12

Digital Logic  Implemented using MOS transistors 13 P-type substrate N-type Source Gate Drain Channel - - -

MOS transistor 14 +V

Inverter (NOT gate) 15 +V

NOR 16 +V

NAND 17 +V

How do we get AND and OR gates? 18

XOR? 19

Gates with more inputs 20 ?

1-bit add 21 A B OUT Carry OUT

Full Adder 22 A B OUT Carry OUTCarry IN

Full adder 23 A B Cin S (Ouptut) A B Cout

Full Adder Truth Table 24

Full Adder Karnaugh Map 25

3-bit add? 26 1-bit Full Adder Cin B0A0 S0 Cout 1-bit Full Adder Cin B1A1 S1 Cout 1-bit Full Adder Cin B2A2 S2 Cout Data dependence serializes the additions!

Keeping State 27 We use latches and flip-flops – Here is an SR latch

D latch 28 When E is 1 – When D=1, make the S signal be 0 (OUT -> 1) – When D=0, make the R signal be 0 (OUT -> 0) – When E is 0, both S and R are 1 (OUT unchanged) S R OUT D(ata) E(nable) D (inverted D input)

Flip-Flop?  Essentially two latches in series:  Latch 1 has CLK connected to its “Enable” – Keeps latching changes in input value while clock is 0 – When clock becomes 0, it keeps what it had  Latch 2 has CLK connected to its enable – Keep latching the output of Latch 1 while clock is 1 – Keeps same output value when clock is 0  While clock is 0, Latch 2 outputs the stored bit  When clock becomes 1, Latch 2 outputs 29

How the flip-flop works  While clock is 0 – Output of Latch 1 follows the input – But Latch 2 outputs the stored bit  When clock changes from 0 to 1 – Latch 1 stops following the input – Latch 2 now outputs what Latch 1 is outputting – Result: FF output == FF input when clock went 0->1  When clock changes back to 0 – Latch 1 starts following the input again – But Latch 2 now keeps what it had – Result: FF output unchanged until clock goes 0->1 30