ECE380 Digital Logic. Positional representation

Similar documents
Conversions between Decimal and Binary

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System?

ENGIN 112 Intro to Electrical and Computer Engineering

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

Numbers and Arithmetic

Numbers and Arithmetic

Fundamentals of Digital Design

Four Important Number Systems

Hakim Weatherspoon CS 3410 Computer Science Cornell University

CSE 241 Digital Systems Spring 2013

CHAPTER 2 NUMBER SYSTEMS

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1

Number Representations

Week No. 06: Numbering Systems

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits

Total Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary.

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018

Chapter 1 CSCI

Numbers & Arithmetic. Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University. See: P&H Chapter , 3.2, C.5 C.

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding

Lecture 8: Sequential Multipliers

hexadecimal-to-decimal conversion

Binary addition example worked out

Lecture 2 Review on Digital Logic (Part 1)

Number System. Decimal to binary Binary to Decimal Binary to octal Binary to hexadecimal Hexadecimal to binary Octal to binary

Number Theory: Representations of Integers

12/31/2010. Digital Operations and Computations Course Notes. 01-Number Systems Text: Unit 1. Overview. What is a Digital System?

ENGIN 112 Intro to Electrical and Computer Engineering

CprE 281: Digital Logic

Carry Look Ahead Adders

Hardware Design I Chap. 4 Representative combinational logic

ENG2410 Digital Design Introduction to Digital Systems. Fall 2017 S. Areibi School of Engineering University of Guelph

Combinational Logic Design Arithmetic Functions and Circuits

Introduction to Digital Logic

Chapter 5 Arithmetic Circuits

CS 140 Lecture 14 Standard Combinational Modules

Number representation

NUMBERS AND CODES CHAPTER Numbers

ELCT201: DIGITAL LOGIC DESIGN

Computer Architecture, IFE CS and T&CS, 4 th sem. Representation of Integer Numbers in Computer Systems

Binary addition by hand. Adding two bits

Midterm Exam Two is scheduled on April 8 in class. On March 27 I will help you prepare Midterm Exam Two.

ECE 372 Microcontroller Design

Complement Arithmetic

CPE100: Digital Logic Design I

Combinational Logic. By : Ali Mustafa

Counting in Different Number Systems

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Graduate Institute of Electronics Engineering, NTU Basic Division Scheme

Introduction to Digital Logic Missouri S&T University CPE 2210 Number Systems

ECE260: Fundamentals of Computer Engineering

2.5 정수와알고리즘 (Integers and Algorithms)

CISC 1400 Discrete Structures

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

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

Number System conversions

ALU (3) - Division Algorithms

Please read carefully. Good luck & Go Gators!!!

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

The Design Procedure. Output Equation Determination - Derive output equations from the state table

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Residue Number Systems Ivor Page 1

Class Website:

ECE 645: Lecture 3. Conditional-Sum Adders and Parallel Prefix Network Adders. FPGA Optimized Adders

Introduction to Digital Logic Missouri S&T University CPE 2210 Number Systems

Looking at a two binary digit sum shows what we need to extend addition to multiple binary digits.

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

Multiplication of signed-operands

convert a two s complement number back into a recognizable magnitude.

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

Arithmetic Circuits-2

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors

UNIT III Design of Combinational Logic Circuits. Department of Computer Science SRM UNIVERSITY

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

Lecture 7: Logic design. Combinational logic circuits

Digital Circuits ECS 371

Digital Systems Roberto Muscedere Images 2013 Pearson Education Inc. 1

Math 230 Assembly Language Programming (Computer Organization) Numeric Data Lecture 2

CSCI 255. S i g n e d N u m s / S h i f t i n g / A r i t h m e t i c O p s.

EECS150 - Digital Design Lecture 24 - Arithmetic Blocks, Part 2 + Shifters

Chapter 03: Computer Arithmetic. Lesson 03: Arithmetic Operations Adder and Subtractor circuits Design

Sample Marking Scheme

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.

Overview. Arithmetic circuits. Binary half adder. Binary full adder. Last lecture PLDs ROMs Tristates Design examples

1 Computing System 2. 2 Data Representation Number Systems 22

CSE 20 DISCRETE MATH. Fall

Menu. 7-Segment LED. Misc. 7-Segment LED MSI Components >MUX >Adders Memory Devices >D-FF, RAM, ROM Computer/Microprocessor >GCPU

SAMPLE ANSWERS MARKER COPY

Chapter 9 - Number Systems

CprE 281: Digital Logic

Mark Redekopp, All rights reserved. Lecture 1 Slides. Intro Number Systems Logic Functions

ELEN Electronique numérique

Lecture 5: Arithmetic

Binary addition (1-bit) P Q Y = P + Q Comments Carry = Carry = Carry = Carry = 1 P Q

Transcription:

ECE380 Digital Logic Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Dr. D. J. Jackson Lecture 16-1 Positional representation First consider integers Begin with positive only descriptions and expand to include negative numbers Numbers that are positive only are unsigned and numbers that can also assume negative values are signed For the decimal system: A number consists of digits having ten possible values (0-9) Each digit represents a multiple of a power of 10 (123) 10 =1x10 2 +2x10 1 +3x10 0 In general, an integer is represented by n decimal digits D=d n-1 d n-2...d 1 d 0 Representing the value V(D)=d n-1 x10 n-1 + d n-2 x10 n-2 +...+ d 1 x10 1 + d 0 x10 0 Dr. D. J. Jackson Lecture 16-2 1

Positional representation Because the digits have 10 possible values and each digit is weighted as a power of 10, we say that decimal numbers are base-10 or radix-10 numbers In digital systems we commonly use the binary, or base-2, number system in which digits can be 0 or 1 Each digit is called a bit The positional representation is B=b n-1 b n-2...b 1 b 0 Representing a integer with the value V(B)=b n-1 x2 n-1 + b n-2 x2 n-2 +...+ b 1 x2 1 + b 0 x2 0 Dr. D. J. Jackson Lecture 16-3 Positional representation The binary number 1101 represents the value V=1x2 3 + 1x2 2 + 0x2 1 + 1x2 0 V=8+4+1=13 So (1101) 2 =(13) 10 The range of numbers that can be represented by a binary number depends of the number of bits used In general, using n bits allows a representation of positive integers in the range 0 to 2 n -1 Most significant Bit (MSB) Least significant Bit (LSB) Dr. D. J. Jackson Lecture 16-4 2

Decimal/Binary conversion A binary number can be converted to a decimal number directly by evaluating the expression V(B)=b n-1 x2 n-1 + b n-2 x2 n-2 +...+ b 1 x2 1 + b 0 x2 0 using decimal arithmetic (by expansion) Converting from a decimal to a binary number can be preformed by successively dividing the decimal number by 2 as follows Divide the decimal number (D) by 2 producing a quotient D/2 and a remainder. The remainder will be 0 or 1 (since we divide by 2) and will represent a single bit (the LSB) of the binary equivalent Repeatedly divide the generated quotient by 2 until the quotient=0. For each divide, the remainder represents one of the binary digits (bits) of the binary equivalent Dr. D. J. Jackson Lecture 16-5 Decimal/Binary conversion Dr. D. J. Jackson Lecture 16-6 3

Octal and hexadecimal numbers Positional notation can be used for any radix (base). If the radix is r, then the number K=k n-1 k n-2...k 1 k 0 has the value V( K) n 1 k ri i i 0 Numbers with radix-8 are called octal and numbers with radix-16 are called hexadecimal (or hex) For octal, digit values range from 0 to 7 For hex, digital values range from 0-9 and A-F Dr. D. J. Jackson Lecture 16-7 Numbers in different systems Decimal Binary Octal Hex 0 0000 0 0 1 0001 1 1 2 0010 2 2 3 0011 3 3 4 0100 4 4 5 0101 5 5 6 0110 6 6 7 0111 7 7 Decimal Binary Octal Hex 8 1000 10 8 9 1001 11 9 10 1010 12 A 11 1011 13 B 12 1100 14 C 13 1101 15 D 14 1110 16 E 15 1111 17 F Dr. D. J. Jackson Lecture 16-8 4

Binary to hex or octal conversion Group binary digits into groups of four and assign each group a hexadecimal digit. 0110 1011 0111 6 B 7 Binary-to-octal: 011 010 110 111 3 2 6 7 Hexadecimal-to-binary: A 1 9 1010 0001 1001 Octal-to-binary: 5 0 3 1 101 000 011 001 Dr. D. J. Jackson Lecture 16-9 Unsigned number addition Additional of two 1-bit numbers gives four possible combinations x y c s x + y 0 + 0 0 + 1 1 + 0 1 + 1 0 0 0 0 0 1 0 1 c s 0 0 0 1 0 1 1 0 1 0 0 1 1 1 1 0 carry sum x y HA s c Dr. D. J. Jackson Lecture 16-10 5

Unsigned number addition Larger numbers have more bits involved There is still the need to add each pair of bits But, for each bit position i, the addition operation may include a carry-in from bit position i-1 X=x 4 x 3 x 2 x 1 x 0 0 1 1 1 1 (15) 10 Y=y 4 y 3 y 2 y 1 y 0 0 1 0 1 0 (10) 10 1 1 1 0 Generated carries S=s 4 s 3 s 2 s 1 s 0 1 1 0 0 1 (25) 10 Dr. D. J. Jackson Lecture 16-11 Full adder circuit c i x i y i c i+1 s i+1 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 x i y i c i 00 01 11 10 0 0 1 0 1 1 1 0 1 0 s i =x i y i c i c i x i y i 00 01 11 10 0 0 0 1 0 1 0 1 1 1 c i =x i y i +y i c i +x i c i Dr. D. J. Jackson Lecture 16-12 6

Full adder circuit x i s i y i c i c i+1 Dr. D. J. Jackson Lecture 16-13 Full adder circuit (decomposed) c s i s x s HA c i y i HA c c i i + 1 Block diagram c i x i y i s i c i + 1 Detailed diagram Dr. D. J. Jackson Lecture 16-14 7

Ripple-carry adder In performing addition, we start from the least significant digit and add pairs of digits progressing to the most significant digit If a carry is produced in position i, it is added to operands (digits) in position i+1 A chain of full adders, connected in sequence, can perform this operation Such a configuration is called a ripple-carry adder because of the way the carry signal ripple through from stage to stage Dr. D. J. Jackson Lecture 16-15 Ripple-carry adder y n-1 x n-1 y 1 x 1 y 0 x 0 c n FA c n-1 c 2 FA c 1 FA c 0 S n-1 s 1 s 0 Dr. D. J. Jackson Lecture 16-16 8

Ripple-carry adder Each full adder introduces a certain delay before its s i and c i+1 outputs are valid The propagation delay through the full adder Let this delay be t The carry out of the first stage c 1 arrives at the second stage t after the application of the x 0 and y 0 inputs The carry out of the second stage c 2 arrives at the third stage with a delay of 2 t, and so on The signal c n-1 is valid after (n-1) t, and the complete sum is available after a delay of (n) t The delay obviously depends on the size of the numbers (i.e. the number of bits) Dr. D. J. Jackson Lecture 16-17 9