Number Representations

Size: px
Start display at page:

Download "Number Representations"

Transcription

1 Computer Arithmetic Algorithms Prof. Dae Hyun Kim School of Electrical Engineering and Computer Science Washington State University Number Representations

2 Information Textbook Israel Koren, Computer Arithmetic Algorithms, Prentice Hall,

3 Outline Binary number system Radix conversion Negative numbers Signed-magnitude One s complement Two s complement Addition and subtraction Arithmetic shift operations (sign extension) 3

4 The Binary Number System A binary number of length nn (xx nn 1, xx nn 2,, xx 1, xx 0 ) xx ii : bit ( {0,1}) An nn-digit binary number nn 1 XX = xx nn 1 2 nn 1 + xx nn 2 2 nn xx xx = xx ii 2 ii xx ii {0,1} ii=0 radix Example = = 11 4

5 The Binary Number System Radix-10 numbers: decimal numbers (101) 10 = 101 Radix-2 numbers: binary numbers (101) 2 = 5 Range of representable numbers [XX mmmmmm, XX mmmmmm ] Example: The range of 4-bit unsigned binary numbers: [0, 15] Overflow An arithmetic operation resulting in a number larger than XX mmmmmm or smaller than XX mmmmmm 5

6 The Binary Number System The conventional number systems Nonredundant Every number has a unique representation. Weighted nn 1 XX = ii=0 xx ii ww ii ww ii : weight Positional ww ii depends only on the position of the digit xx ii. ww ii = rr ii 0 xx ii rr 1 Otherwise (if xx ii rr), the system becomes redundant. X xx ii xx kk redundant D dd jj 6

7 The Binary Number System A mixed number (fixed-point representation) (xx kk 1 xx kk 2 xx 1 xx 0. xx 1 xx 2 xx mm ) rr integral part fractional part = (xx kk 1 rr kk 1 + xx kk 2 rr kk xx 1 rr 1 + xx 0 rr 0 ) + (xx 1 rr xx mm rr mm ) kk 1 = xx ii rr ii ii= mm rr mm : indicates the position of the radix point. ulp: unit in the last position uuuuuu = rr mm 7

8 Radix Conversion Given XX = XX II + XX FF = kk 1 ii=0 xx ii rr ii + 1 ii= mm xx ii rr ii XX II : integral part XX FF : fractional part rr DD : destination number system Integral part XX II = xx 0 + rr DD (xx 1 + rr DD (xx rr DD (xx kk 2 + rr DD xx kk 1 ))) 0 xx ii < rr DD xx 0 = XX II mmmmmm rr DD qq 0 = xx 1 + rr DD xx 2 + rr DD xx 3 + xx 1 = qq 0 mmmmmm rr DD... 8

9 Radix Conversion Fractional part XX FF = rr DD 1 (xx 1 + rr DD 1 (xx rr DD 1 (xx mm 1 + rr DD 1 xx mm ))) 0 xx ii < rr DD xx 1 : the integral part of XX FF rr DD mm 1 = rr DD 1 (xx rr DD 1 (xx mm 1 + rr DD 1 xx mm )) xx 2 : the integral part of mm 1 rr DD... Example =

10 Negative Numbers: Signed-Magnitude Representation (xx ss xx nn 2 xx nn 3 xx 1 xx 0 ) sign magnitude Positive numbers: 0xxxxx 0xxxxx 2 Negative numbers: (r-1)xxxxx 1xxxxx 2 Range of positive numbers for (ss xx kk 2 xx kk 3 xx 1 xx 0. xx 1 xx 2 xx mm ) [0, rr kk 1 uuuuuu] Range of negative numbers for (ss xx kk 2 xx kk 3 xx 1 xx 0. xx 1 xx 2 xx mm ) [ (rr kk 1 uuuuuu), 0] 10

11 Negative Numbers: Signed-Magnitude Problems Two zeros Difficulties in subtraction If X>Y, X-Y is ok. However, Y-X is -(X-Y), so we should compute X-Y, then set the MSB to 1. 11

12 Negative Numbers: Complement Represent Y by R Y. Then, ( Y) = R (R Y) = Y. If X>Y>0, Y X = Y + (R X) = R (X Y) = X Y. Two requirements When X>Y>0, X Y = X + (R Y) = R + (X Y) should be X Y. Computation of R Y should be simple. Notation xx ii = rr 1 xx ii XX = (xx kk 1, xx kk 2,, xx 0, xx 1,, xx mm ) XX + XX = ( rr 1, rr 1,, (rr 1)) XX + XX + uuuuuu = rr kk 12

13 Negative Numbers: Complement One s complement (Diminished-radix complement) RR = rr kk uuuuuu XX = RR XX = XX When X>Y>0, YY XX = YY + RR XX = RR XX YY = (YY XX) When X>Y>0, XX YY = XX + RR YY = RR + XX YY = rr kk + XX YY uuuuuu = XX YY uuuuuu This requires a correction step (add ulp). When X>0, Y>0, XX YY = RR XX + RR YY = RR + RR XX + YY = rr kk + RR XX + YY = RR XX + YY = (XX + YY) Two s complement (Radix complement) RR = rr kk XX = RR XX = XX + uuuuuu When X>Y>0, YY XX = YY + RR XX = RR YY XX = (YY XX) When X>Y>0, XX YY = XX + RR YY = RR + XX YY = rr kk + XX YY = XX YY When X>0, Y>0, XX YY = RR XX + RR YY = RR + RR XX + YY = rr kk + RR XX + YY = RR XX + YY = (XX + YY) 13

14 Two s Complement Representation One zero A negative number that does not have a positive equivalent Range [ 2 nn 1, 2 nn 1 uuuuuu] XX = xx nn 1 2 nn 1 + nn 2 ii=0 xx ii 2 ii Proof) If xx nn 1 = 0 (positive), XX = nn 2 ii=0 xx ii 2 ii = xx nn 1 2 nn 1 + nn 2 xx ii 2 ii If xx nn 1 = 1 (negative), XX = XX + uuuuuu = [ nn 1 ii=0 xx ii 2 ii + 1] = ii=0 nn 1 1 xx ii 2 ii + 1 = 2 nn 1 nn 1 ii=0 xx ii 2 ii + 1 nn 1 nn 2 = 2 nn + ii=0 xx ii 2 ii = 2 nn 1 + ii=0 xx ii 2 ii ii=0. 14

15 One s Complement Representation Two zeros Range [ 2 nn 1 uuuuuu, 2 nn 1 uuuuuu ] XX = xx nn 1 2 nn 1 uuuuuu + nn 2 xx ii 2 ii ii=0 Proof) If xx nn 1 = 0 (positive), XX = ii=0 xx ii 2 ii = xx nn 1 (2 nn 1 uuuuuu) + nn 2 xx ii 2 ii ii=0. nn 2 nn 1 nn 1 If xx nn 1 = 1 (negative), XX = XX = ii=0 xx ii 2 ii = ii=0 1 xx ii 2 ii = 2 nn 1 nn 1 ii=0 xx ii 2 ii = 2 nn nn 1 ii=0 xx ii 2 ii = 2 nn nn 2 ii=0 xx ii 2 ii = xx nn 1 (2 nn 1 uuuuuu) + ii=0 nn 2 xx ii 2 ii 15

16 Addition and Subtraction Signed-magnitude (11) (2) = (13) (11) (6) = (-1) (-3) (-5) = (+8) (-8) (-9) = (-1) overflow overflow overflow (13) (-8) = (5) (-13) (8) = (+5) As shown above, addition and subtraction of signed-magnitude numbers need corrections. 16

17 Addition and Subtraction Two s complement (11) (2) = (13) (11) (6) = (-15) (-3) (-5) = (-8) (-8) (-9) = (-17) overflow indicator overflow indicator (13) (-8) = (5) (-13) (8) = (-5) 17

18 Arithmetic Shift Operations For given {xx nn 1, xx nn 2,, xx 1, xx 0 } Signed-magnitude xx nn 1, 0, 0,, 0, xx nn 2,, xx 1, xx 0, 0, 0, Two s complement xx nn 1, xx nn 1,, xx nn 1, xx nn 1, xx nn 2,, xx 1, xx 0, 0, 0, One s complement xx nn 1, xx nn 1,, xx nn 1, xx nn 1, xx nn 2,, xx 1, xx 0, xx nn 1, xx nn 1, 18

19 Supplementary Materials

20 Arithmetic Shift Operations Derivation of the extension of the two s complement XX = XX nn 1 0 = {xx nn 1, xx nn 2,, xx 1, xx 0 } If X>0, it is the same as the signed-magnitude case. If X<0 (if X -2 n ), XX = XX nn 1 0 = xx nn 1, xx nn 2,, xx 1, xx 0 XX = {XX nn uuuuuu 0 } ( XX) ext = 00 0 XX nn uuuuuu = 00 0 KK 00 0 XX ext = 00 0 KK uuuuuu mm = 11 1 KK uuuuuu mm = 11 1 KK + uuuuuu = nn KK 00 0 = nn XX nn uuuuuu = 11 1 XX nn XX ext = xx nn 1 xx nn 1 xx nn 1, xx nn 2,, xx 1, xx If X=2 n, we can directly prove it. 20

21 Arithmetic Shift Operations Derivation of the extension of the one s complement XX = XX nn 1 0 = {xx nn 1, xx nn 2,, xx 1, xx 0 } If X>0, it is the same as the signed-magnitude case. If X<0, XX = XX nn 1 0 = xx nn 1, xx nn 2,, xx 1, xx 0 XX = {XX nn 1 0 } ( XX) ext = 00 0 XX nn XX ext = 00 0 XX nn = 11 1 XX nn XX ext = xx nn 1 xx nn 1 xx nn 1, xx nn 2,, xx 1, xx 0 xx nn 1 xx nn 1 21

Complement Arithmetic

Complement Arithmetic Complement Arithmetic Objectives In this lesson, you will learn: How additions and subtractions are performed using the complement representation, What is the Overflow condition, and How to perform arithmetic

More information

ECE380 Digital Logic. Positional representation

ECE380 Digital Logic. Positional representation 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

More information

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

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

14:332:231 DIGITAL LOGIC DESIGN. Why Binary Number System? :33:3 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 3 Lecture #: Binary Number System Complement Number Representation X Y Why Binary Number System? Because

More information

ENGIN 112 Intro to Electrical and Computer Engineering

ENGIN 112 Intro to Electrical and Computer Engineering ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems Overview Hexadecimal numbers Related to binary and octal numbers Conversion between hexadecimal, octal and binary Value

More information

Worksheets for GCSE Mathematics. Quadratics. mr-mathematics.com Maths Resources for Teachers. Algebra

Worksheets for GCSE Mathematics. Quadratics. mr-mathematics.com Maths Resources for Teachers. Algebra Worksheets for GCSE Mathematics Quadratics mr-mathematics.com Maths Resources for Teachers Algebra Quadratics Worksheets Contents Differentiated Independent Learning Worksheets Solving x + bx + c by factorisation

More information

Lecture 2 Review on Digital Logic (Part 1)

Lecture 2 Review on Digital Logic (Part 1) Lecture 2 Review on Digital Logic (Part 1) Xuan Silvia Zhang Washington University in St. Louis http://classes.engineering.wustl.edu/ese461/ Grading Engagement 5% Review Quiz 10% Homework 10% Labs 40%

More information

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

Menu. Review of Number Systems EEL3701 EEL3701. Math. Review of number systems >Binary math >Signed number systems Menu Review of number systems >Binary math >Signed number systems Look into my... 1 Our decimal (base 10 or radix 10) number system is positional. Ex: 9437 10 = 9x10 3 + 4x10 2 + 3x10 1 + 7x10 0 We have

More information

Chapter 1 CSCI

Chapter 1 CSCI Chapter 1 CSCI-1510-003 What is a Number? An expression of a numerical quantity A mathematical quantity Many types: Natural Numbers Real Numbers Rational Numbers Irrational Numbers Complex Numbers Etc.

More information

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

UNSIGNED BINARY NUMBERS DIGITAL ELECTRONICS SYSTEM DESIGN WHAT ABOUT NEGATIVE NUMBERS? BINARY ADDITION 11/9/2018 DIGITAL ELECTRONICS SYSTEM DESIGN LL 2018 PROFS. IRIS BAHAR & ROD BERESFORD NOVEMBER 9, 2018 LECTURE 19: BINARY ADDITION, UNSIGNED BINARY NUMBERS For the binary number b n-1 b n-2 b 1 b 0. b -1 b -2 b

More information

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

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations. EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions

More information

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

14:332:231 DIGITAL LOGIC DESIGN. 2 s-complement Representation 4:332:23 DIGITAL LOGIC DESIGN Ivan Marsic, Rutgers University Electrical & Computer Engineering Fall 203 Lecture #3: Addition, Subtraction, Multiplication, and Division 2 s-complement Representation RECALL

More information

Recurrence Relations

Recurrence Relations Recurrence Relations Recurrence Relations Reading (Epp s textbook) 5.6 5.8 1 Recurrence Relations A recurrence relation for a sequence aa 0, aa 1, aa 2, ({a n }) is a formula that relates each term a k

More information

Chapter 4 Number Representations

Chapter 4 Number Representations Chapter 4 Number Representations SKEE2263 Digital Systems Mun im/ismahani/izam {munim@utm.my,e-izam@utm.my,ismahani@fke.utm.my} February 9, 2016 Table of Contents 1 Fundamentals 2 Signed Numbers 3 Fixed-Point

More information

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

Logic and Computer Design Fundamentals. Chapter 5 Arithmetic Functions and Circuits Logic and Computer Design Fundamentals Chapter 5 Arithmetic Functions and Circuits Arithmetic functions Operate on binary vectors Use the same subfunction in each bit position Can design functional block

More information

CSE 241 Digital Systems Spring 2013

CSE 241 Digital Systems Spring 2013 CSE 241 Digital Systems Spring 2013 Instructor: Prof. Kui Ren Department of Computer Science and Engineering Lecture slides modified from many online resources and used solely for the educational purpose.

More information

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

Total Time = 90 Minutes, Total Marks = 100. Total /10 /25 /20 /10 /15 /20 University of Waterloo Department of Electrical & Computer Engineering E&CE 223 Digital Circuits and Systems Midterm Examination Instructor: M. Sachdev October 30th, 2006 Total Time = 90 Minutes, Total

More information

ECE260: Fundamentals of Computer Engineering

ECE260: Fundamentals of Computer Engineering Data Representation & 2 s Complement James Moscola Dept. of Engineering & Computer Science York College of Pennsylvania Based on Computer Organization and Design, 5th Edition by Patterson & Hennessy Data

More information

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

Computer Architecture, IFE CS and T&CS, 4 th sem. Representation of Integer Numbers in Computer Systems Representation of Integer Numbers in Computer Systems Positional Numbering System Additive Systems history but... Roman numerals Positional Systems: r system base (radix) A number value a - digit i digit

More information

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors

Introduction to Digital Logic Missouri S&T University CPE 2210 Subtractors Introduction to Digital Logic Missouri S&T University CPE 2210 Egemen K. Çetinkaya Egemen K. Çetinkaya Department of Electrical & Computer Engineering Missouri University of Science and Technology cetinkayae@mst.edu

More information

Definition: A sequence is a function from a subset of the integers (usually either the set

Definition: A sequence is a function from a subset of the integers (usually either the set Math 3336 Section 2.4 Sequences and Summations Sequences Geometric Progression Arithmetic Progression Recurrence Relation Fibonacci Sequence Summations Definition: A sequence is a function from a subset

More information

Lecture 8: Sequential Multipliers

Lecture 8: Sequential Multipliers Lecture 8: Sequential Multipliers ECE 645 Computer Arithmetic 3/25/08 ECE 645 Computer Arithmetic Lecture Roadmap Sequential Multipliers Unsigned Signed Radix-2 Booth Recoding High-Radix Multiplication

More information

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

0,..., r 1 = digits in radix r number system, that is 0 d i r 1 where m i n 1 RADIX r NUMBER SYSTEM Let (N) r be a radix r number in a positional weighting number system, then (N) r = d n 1 r n 1 + + d 0 r 0 d 1 r 1 + + d m r m where: r = radix d i = digit at position i, m i n 1

More information

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals. Last (family) name: First (given) name: Student I.D. #: Circle section: Lipasti Kim Department of Electrical and Computer Engineering University of Wisconsin - Madison ECE/CS 352 Digital System Fundamentals

More information

CS 140 Lecture 14 Standard Combinational Modules

CS 140 Lecture 14 Standard Combinational Modules CS 14 Lecture 14 Standard Combinational Modules Professor CK Cheng CSE Dept. UC San Diego Some slides from Harris and Harris 1 Part III. Standard Modules A. Interconnect B. Operators. Adders Multiplier

More information

CHAPTER 2 NUMBER SYSTEMS

CHAPTER 2 NUMBER SYSTEMS CHAPTER 2 NUMBER SYSTEMS The Decimal Number System : We begin our study of the number systems with the familiar decimal number system. The decimal system contains ten unique symbol 0, 1, 2, 3, 4, 5, 6,

More information

CpE358/CS381. Switching Theory and Logical Design. Summer

CpE358/CS381. Switching Theory and Logical Design. Summer Switching Theory and Logical Design - Class Schedule Monday Tuesday Wednesday Thursday Friday May 7 8 9 - Class 2 - Class 2 2 24 - Class 3 25 26 - Class 4 27 28 Quiz Commencement 3 June 2 - Class 5 3 -

More information

Computer Organization I CRN Test 3/Version 1 CMSC 2833 CRN Spring 2017

Computer Organization I CRN Test 3/Version 1 CMSC 2833 CRN Spring 2017 . Print your name on your SANTRON in the space labeled NAME. 2. Print MS 2833 in the space labeled SUBJET. 3. Print the date 5-3-27, in the space labeled DATE. 4. Print your RN in the space labeled PERIOD.

More information

Fundamentals of Digital Design

Fundamentals of Digital Design Fundamentals of Digital Design Digital Radiation Measurement and Spectroscopy NE/RHP 537 1 Binary Number System The binary numeral system, or base-2 number system, is a numeral system that represents numeric

More information

hexadecimal-to-decimal conversion

hexadecimal-to-decimal conversion OTHER NUMBER SYSTEMS: octal (digits 0 to 7) group three binary numbers together and represent as base 8 3564 10 = 110 111 101 100 2 = (6X8 3 ) + (7X8 2 ) + (5X8 1 ) + (4X8 0 ) = 6754 8 hexadecimal (digits

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

More information

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

Numbering Systems. Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Numbering Systems Contents: Binary & Decimal. Converting From: B D, D B. Arithmetic operation on Binary. Addition & Subtraction using Octal & Hexadecimal 2 s Complement, Subtraction Using 2 s Complement.

More information

Two Posts to Fill On School Board

Two Posts to Fill On School Board Y Y 9 86 4 4 qz 86 x : ( ) z 7 854 Y x 4 z z x x 4 87 88 Y 5 x q x 8 Y 8 x x : 6 ; : 5 x ; 4 ( z ; ( ) ) x ; z 94 ; x 3 3 3 5 94 ; ; ; ; 3 x : 5 89 q ; ; x ; x ; ; x : ; ; ; ; ; ; 87 47% : () : / : 83

More information

1. The graph of a function f is given above. Answer the question: a. Find the value(s) of x where f is not differentiable. Ans: x = 4, x = 3, x = 2,

1. The graph of a function f is given above. Answer the question: a. Find the value(s) of x where f is not differentiable. Ans: x = 4, x = 3, x = 2, 1. The graph of a function f is given above. Answer the question: a. Find the value(s) of x where f is not differentiable. x = 4, x = 3, x = 2, x = 1, x = 1, x = 2, x = 3, x = 4, x = 5 b. Find the value(s)

More information

Chapter 22 : Electric potential

Chapter 22 : Electric potential Chapter 22 : Electric potential What is electric potential? How does it relate to potential energy? How does it relate to electric field? Some simple applications What does it mean when it says 1.5 Volts

More information

ELCT201: DIGITAL LOGIC DESIGN

ELCT201: DIGITAL LOGIC DESIGN ELCT2: DIGITAL LOGIC DESIGN Dr. Eng. Haitham Omran, haitham.omran@guc.edu.eg Dr. Eng. Wassim Alexan, wassim.joseph@guc.edu.eg Lecture 4 Following the slides of Dr. Ahmed H. Madian محرم 439 ه Winter 28

More information

P.3 Division of Polynomials

P.3 Division of Polynomials 00 section P3 P.3 Division of Polynomials In this section we will discuss dividing polynomials. The result of division of polynomials is not always a polynomial. For example, xx + 1 divided by xx becomes

More information

Binary Floating-Point Numbers

Binary Floating-Point Numbers Binary Floating-Point Numbers S exponent E significand M F=(-1) s M β E Significand M pure fraction [0, 1-ulp] or [1, 2) for β=2 Normalized form significand has no leading zeros maximum # of significant

More information

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

LOGIC GATES. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D. Basic Eperiment and Design of Electronics LOGIC GATES Ho Kyung Kim, Ph.D. hokyung@pusan.ac.kr School of Mechanical Engineering Pusan National University Outline Boolean algebra Logic gates Karnaugh maps

More information

Combinational Logic Design Arithmetic Functions and Circuits

Combinational Logic Design Arithmetic Functions and Circuits Combinational Logic Design Arithmetic Functions and Circuits Overview Binary Addition Half Adder Full Adder Ripple Carry Adder Carry Look-ahead Adder Binary Subtraction Binary Subtractor Binary Adder-Subtractor

More information

ECE 372 Microcontroller Design

ECE 372 Microcontroller Design Data Formats Humor There are 10 types of people in the world: Those who get binary and those who don t. 1 Information vs. Data Information An abstract description of facts, processes or perceptions How

More information

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

More information

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

convert a two s complement number back into a recognizable magnitude. 1 INTRODUCTION The previous lesson introduced binary and hexadecimal numbers. In this lesson we look at simple arithmetic operations using these number systems. In particular, we examine the problem of

More information

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

Please read carefully. Good luck & Go Gators!!! Page 1/12 Exam 1 May the Schwartz be with you! Instructions: Turn off all cell phones and other noise making devices and put away all electronics Show all work on the front of the test papers Box each

More information

CprE 281: Digital Logic

CprE 281: Digital Logic CprE 281: Digital Logic Instructor: Alexander Stoytchev http://www.ece.iastate.edu/~alexs/classes/ Signed Numbers CprE 281: Digital Logic Iowa State University, Ames, IA Copyright Alexander Stoytchev Administrative

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Four Important Number Systems

Four Important Number Systems Four Important Number Systems System Why? Remarks Decimal Base 10: (10 fingers) Most used system Binary Base 2: On/Off systems 3-4 times more digits than decimal Octal Base 8: Shorthand notation for working

More information

LOWELL WEEKLY JOURNAL. ^Jberxy and (Jmott Oao M d Ccmsparftble. %m >ai ruv GEEAT INDUSTRIES

LOWELL WEEKLY JOURNAL. ^Jberxy and (Jmott Oao M d Ccmsparftble. %m >ai ruv GEEAT INDUSTRIES ? (») /»» 9 F ( ) / ) /»F»»»»»# F??»»» Q ( ( »»» < 3»» /» > > } > Q ( Q > Z F 5

More information

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

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 CDA 3200 Digital Systems Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012 Outline Combinational Logic Design Using a Truth Table Minterm and Maxterm Expansions General Minterm and

More information

Number Representation and Waveform Quantization

Number Representation and Waveform Quantization 1 Number Representation and Waveform Quantization 1 Introduction This lab presents two important concepts for working with digital signals. The first section discusses how numbers are stored in memory.

More information

L8/9: Arithmetic Structures

L8/9: Arithmetic Structures L8/9: Arithmetic Structures Acknowledgements: Materials in this lecture are courtesy of the following sources and are used with permission. Rex Min Kevin Atkinson Prof. Randy Katz (Unified Microelectronics

More information

KEYWORDS: Multiple Valued Logic (MVL), Residue Number System (RNS), Quinary Logic (Q uin), Quinary Full Adder, QFA, Quinary Half Adder, QHA.

KEYWORDS: Multiple Valued Logic (MVL), Residue Number System (RNS), Quinary Logic (Q uin), Quinary Full Adder, QFA, Quinary Half Adder, QHA. GLOBAL JOURNAL OF ADVANCED ENGINEERING TECHNOLOGIES AND SCIENCES DESIGN OF A QUINARY TO RESIDUE NUMBER SYSTEM CONVERTER USING MULTI-LEVELS OF CONVERSION Hassan Amin Osseily Electrical and Electronics Department,

More information

課程名稱 : 數位邏輯設計 P-1/ /6/11

課程名稱 : 數位邏輯設計 P-1/ /6/11 課程名稱 : 數位邏輯設計 P-1/55 2012/6/11 Textbook: Digital Design, 4 th. Edition M. Morris Mano and Michael D. Ciletti Prentice-Hall, Inc. 教師 : 蘇慶龍 INSTRUCTOR : CHING-LUNG SU E-mail: kevinsu@yuntech.edu.tw Chapter

More information

OWELL WEEKLY JOURNAL

OWELL WEEKLY JOURNAL Y \»< - } Y Y Y & #»»» q ] q»»»>) & - - - } ) x ( - { Y» & ( x - (» & )< - Y X - & Q Q» 3 - x Q Y 6 \Y > Y Y X 3 3-9 33 x - - / - -»- --

More information

Graduate Institute of Electronics Engineering, NTU Basic Division Scheme

Graduate Institute of Electronics Engineering, NTU Basic Division Scheme Basic Division Scheme 台灣大學電子所吳安宇博士 2002 ACCESS IC LAB Outline Shift/subtract division algorithm. Programmed division. Restoring hardware dividers. Nonstoring and signed division. Radix-2 SRT divisioin.

More information

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017

Design of Digital Circuits Reading: Binary Numbers. Required Reading for Week February 2017 Spring 2017 Design of Digital Circuits Reading: Binary Numbers Required Reading for Week 1 23-24 February 2017 Spring 2017 Binary Numbers Design of Digital Circuits 2016 Srdjan Capkun Frank K. Gürkaynak http://www.syssec.ethz.ch/education/digitaltechnik_16

More information

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic

Computer Arithmetic. MATH 375 Numerical Analysis. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Computer Arithmetic Computer Arithmetic MATH 375 Numerical Analysis J. Robert Buchanan Department of Mathematics Fall 2013 Machine Numbers When performing arithmetic on a computer (laptop, desktop, mainframe, cell phone,

More information

Lecture 8. Sequential Multipliers

Lecture 8. Sequential Multipliers Lecture 8 Sequential Multipliers Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 9, Basic Multiplication Scheme Chapter 10, High-Radix Multipliers Chapter

More information

Elements of Floating-point Arithmetic

Elements of Floating-point Arithmetic Elements of Floating-point Arithmetic Sanzheng Qiao Department of Computing and Software McMaster University July, 2012 Outline 1 Floating-point Numbers Representations IEEE Floating-point Standards Underflow

More information

Hakim Weatherspoon CS 3410 Computer Science Cornell University

Hakim Weatherspoon CS 3410 Computer Science Cornell University Hakim Weatherspoon CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer. memory inst 32 register

More information

DSP Design Lecture 2. Fredrik Edman.

DSP Design Lecture 2. Fredrik Edman. DSP Design Lecture Number representation, scaling, quantization and round-off Noise Fredrik Edman fredrik.edman@eit.lth.se Representation of Numbers Numbers is a way to use symbols to describe and model

More information

Chapter 1: Solutions to Exercises

Chapter 1: Solutions to Exercises 1 DIGITAL ARITHMETIC Miloš D. Ercegovac and Tomás Lang Morgan Kaufmann Publishers, an imprint of Elsevier, c 2004 Exercise 1.1 (a) 1. 9 bits since 2 8 297 2 9 2. 3 radix-8 digits since 8 2 297 8 3 3. 3

More information

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

ECE 545 Digital System Design with VHDL Lecture 1. Digital Logic Refresher Part A Combinational Logic Building Blocks ECE 545 Digital System Design with VHDL Lecture Digital Logic Refresher Part A Combinational Logic Building Blocks Lecture Roadmap Combinational Logic Basic Logic Review Basic Gates De Morgan s Law Combinational

More information

Lecture 11. Advanced Dividers

Lecture 11. Advanced Dividers Lecture 11 Advanced Dividers Required Reading Behrooz Parhami, Computer Arithmetic: Algorithms and Hardware Design Chapter 15 Variation in Dividers 15.3, Combinational and Array Dividers Chapter 16, Division

More information

Combinational Logic. By : Ali Mustafa

Combinational Logic. By : Ali Mustafa Combinational Logic By : Ali Mustafa Contents Adder Subtractor Multiplier Comparator Decoder Encoder Multiplexer How to Analyze any combinational circuit like this? Analysis Procedure To obtain the output

More information

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr.

Chapter 4. Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. elements. Dr. Chapter 4 Dr. Panos Nasiopoulos Combinational: Circuits with logic gates whose outputs depend on the present combination of the inputs. Sequential: In addition, they include storage elements Combinational

More information

Worksheets for GCSE Mathematics. Algebraic Expressions. Mr Black 's Maths Resources for Teachers GCSE 1-9. Algebra

Worksheets for GCSE Mathematics. Algebraic Expressions. Mr Black 's Maths Resources for Teachers GCSE 1-9. Algebra Worksheets for GCSE Mathematics Algebraic Expressions Mr Black 's Maths Resources for Teachers GCSE 1-9 Algebra Algebraic Expressions Worksheets Contents Differentiated Independent Learning Worksheets

More information

Rational Expressions and Functions

Rational Expressions and Functions 1 Rational Expressions and Functions In the previous two chapters we discussed algebraic expressions, equations, and functions related to polynomials. In this chapter, we will examine a broader category

More information

Work, Energy, and Power. Chapter 6 of Essential University Physics, Richard Wolfson, 3 rd Edition

Work, Energy, and Power. Chapter 6 of Essential University Physics, Richard Wolfson, 3 rd Edition Work, Energy, and Power Chapter 6 of Essential University Physics, Richard Wolfson, 3 rd Edition 1 With the knowledge we got so far, we can handle the situation on the left but not the one on the right.

More information

Lowell Dam Gone Out. Streets Turned I n t o Rivers. No Cause For Alarm Now However As This Happened 35 Years A&o

Lowell Dam Gone Out. Streets Turned I n t o Rivers. No Cause For Alarm Now However As This Happened 35 Years A&o V ()\\ ))? K K Y 6 96 Y - Y Y V 5 Z ( z x z \ - \ - - z - q q x x - x 5 9 Q \ V - - Y x 59 7 x x - Y - x - - x z - z x - ( 7 x V 9 z q &? - 9 - V ( x - - - V- [ Z x z - -x > -) - - > X Z z ( V V V

More information

Terms of Use. Copyright Embark on the Journey

Terms of Use. Copyright Embark on the Journey Terms of Use All rights reserved. No part of this packet may be reproduced, stored in a retrieval system, or transmitted in any form by any means - electronic, mechanical, photo-copies, recording, or otherwise

More information

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

E40M. Binary Numbers. M. Horowitz, J. Plummer, R. Howe 1 E40M Binary Numbers M. Horowitz, J. Plummer, R. Howe 1 Reading Chapter 5 in the reader A&L 5.6 M. Horowitz, J. Plummer, R. Howe 2 Useless Box Lab Project #2 Adding a computer to the Useless Box alows us

More information

Ex code

Ex code Ex. 8.4 7-4-2-1 code Codeconverter 7-4-2-1-code to BCD-code. When encoding the digits 0... 9 sometimes in the past a code having weights 7-4-2-1 instead of the binary code weights 8-4-2-1 was used. In

More information

Cryptography CS 555. Topic 13: HMACs and Generic Attacks

Cryptography CS 555. Topic 13: HMACs and Generic Attacks Cryptography CS 555 Topic 13: HMACs and Generic Attacks 1 Recap Cryptographic Hash Functions Merkle-Damgård Transform Today s Goals: HMACs (constructing MACs from collision-resistant hash functions) Generic

More information

Residue Number Systems Ivor Page 1

Residue Number Systems Ivor Page 1 Residue Number Systems 1 Residue Number Systems Ivor Page 1 7.1 Arithmetic in a modulus system The great speed of arithmetic in Residue Number Systems (RNS) comes from a simple theorem from number theory:

More information

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

ECE 545 Digital System Design with VHDL Lecture 1A. Digital Logic Refresher Part A Combinational Logic Building Blocks ECE 545 Digital System Design with VHDL Lecture A Digital Logic Refresher Part A Combinational Logic Building Blocks Lecture Roadmap Combinational Logic Basic Logic Review Basic Gates De Morgan s Laws

More information

A A A A A A A A A A A A. a a a a a a a a a a a a a a a. Apples taste amazingly good.

A A A A A A A A A A A A. a a a a a a a a a a a a a a a. Apples taste amazingly good. Victorian Handwriting Sheet Aa A A A A A A A A A A A A Aa Aa Aa Aa Aa Aa Aa a a a a a a a a a a a a a a a Apples taste amazingly good. Apples taste amazingly good. Now make up a sentence of your own using

More information

MATH 1080: Calculus of One Variable II Fall 2018 Textbook: Single Variable Calculus: Early Transcendentals, 7e, by James Stewart.

MATH 1080: Calculus of One Variable II Fall 2018 Textbook: Single Variable Calculus: Early Transcendentals, 7e, by James Stewart. MATH 1080: Calculus of One Variable II Fall 2018 Textbook: Single Variable Calculus: Early Transcendentals, 7e, by James Stewart Unit 2 Skill Set Important: Students should expect test questions that require

More information

Classical RSA algorithm

Classical RSA algorithm Classical RSA algorithm We need to discuss some mathematics (number theory) first Modulo-NN arithmetic (modular arithmetic, clock arithmetic) 9 (mod 7) 4 3 5 (mod 7) congruent (I will also use = instead

More information

SECTION 7: STEADY-STATE ERROR. ESE 499 Feedback Control Systems

SECTION 7: STEADY-STATE ERROR. ESE 499 Feedback Control Systems SECTION 7: STEADY-STATE ERROR ESE 499 Feedback Control Systems 2 Introduction Steady-State Error Introduction 3 Consider a simple unity-feedback system The error is the difference between the reference

More information

Hardware Design I Chap. 4 Representative combinational logic

Hardware Design I Chap. 4 Representative combinational logic Hardware Design I Chap. 4 Representative combinational logic E-mail: shimada@is.naist.jp Already optimized circuits There are many optimized circuits which are well used You can reduce your design workload

More information

Redesigning The Element Of Random Access Memory (RAM) For Enhanced Computer Processing Speed

Redesigning The Element Of Random Access Memory (RAM) For Enhanced Computer Processing Speed Redesigning The Element Of Random Access Memory (RAM) For Enhanced Computer Processing Speed Samson O. Ogunlere 1, Olawale J. Omotosho 2 1 Computer Engineering Research Scholar, Computer Science Dept.,

More information

Part 5: Digital Circuits

Part 5: Digital Circuits Characteristics of any number system are: Part 5: Digital Circuits 5.: Number Systems & Code Conversions. ase or radix is equal to the number of possible symbols in the system 2. The largest value of digit

More information

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta

Digital System Design Combinational Logic. Assoc. Prof. Pradondet Nilagupta Digital System Design Combinational Logic Assoc. Prof. Pradondet Nilagupta pom@ku.ac.th Acknowledgement This lecture note is modified from Engin112: Digital Design by Prof. Maciej Ciesielski, Prof. Tilman

More information

Systems I: Computer Organization and Architecture

Systems I: Computer Organization and Architecture Systems I: Computer Organization and Architecture Lecture 6 - Combinational Logic Introduction A combinational circuit consists of input variables, logic gates, and output variables. The logic gates accept

More information

Revision : Thermodynamics

Revision : Thermodynamics Revision : Thermodynamics Formula sheet Formula sheet Formula sheet Thermodynamics key facts (1/9) Heat is an energy [measured in JJ] which flows from high to low temperature When two bodies are in thermal

More information

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

Binary Multipliers. Reading: Study Chapter 3. The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding Binary Multipliers The key trick of multiplication is memorizing a digit-to-digit table Everything else was just adding 2 3 4 5 6 7 8 9 2 3 4 5 6 7 8 9 2 2 4 6 8 2 4 6 8 3 3 6 9 2 5 8 2 24 27 4 4 8 2 6

More information

Redundant Radix Enumeration Systems

Redundant Radix Enumeration Systems Redundant Radix Enumeration Systems CS 860: Automatic Sequences Daniel Roche University of Waterloo 21 November 2006 Roche (University of Waterloo) Redundant Radix Enumeration Systems 21 November 2006

More information

Multiplication of signed-operands

Multiplication of signed-operands Multiplication of signed-operands Recall we discussed multiplication of unsigned numbers: Combinatorial array multiplier. Sequential multiplier. Need an approach that works uniformly with unsigned and

More information

Numbers and Arithmetic

Numbers and Arithmetic Numbers and Arithmetic See: P&H Chapter 2.4 2.6, 3.2, C.5 C.6 Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University Big Picture: Building a Processor memory inst register file alu

More information

What s the Deal? MULTIPLICATION. Time to multiply

What s the Deal? MULTIPLICATION. Time to multiply What s the Deal? MULTIPLICATION Time to multiply Multiplying two numbers requires a multiply Luckily, in binary that s just an AND gate! 0*0=0, 0*1=0, 1*0=0, 1*1=1 Generate a bunch of partial products

More information

Review for Exam Hyunse Yoon, Ph.D. Assistant Research Scientist IIHR-Hydroscience & Engineering University of Iowa

Review for Exam Hyunse Yoon, Ph.D. Assistant Research Scientist IIHR-Hydroscience & Engineering University of Iowa 57:020 Fluids Mechanics Fall2013 1 Review for Exam3 12. 11. 2013 Hyunse Yoon, Ph.D. Assistant Research Scientist IIHR-Hydroscience & Engineering University of Iowa 57:020 Fluids Mechanics Fall2013 2 Chapter

More information

ENEL Digital Circuit Design. Final Examination

ENEL Digital Circuit Design. Final Examination ELECTRICAL AND COMPUTER ENGINEERING ENEL 353 - Digital Circuit Design Final Examination Friday, December 17, 1999 Red Gymnasium, 3:30PM - 6:30 PM Instructions: Time allowed is 3 hours. The examination

More information

Eureka Lessons for 6th Grade Unit FIVE ~ Equations & Inequalities

Eureka Lessons for 6th Grade Unit FIVE ~ Equations & Inequalities Eureka Lessons for 6th Grade Unit FIVE ~ Equations & Inequalities These 2 lessons can easily be taught in 2 class periods. If you like these lessons, please consider using other Eureka lessons as well.

More information

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

We are here. Assembly Language. Processors Arithmetic Logic Units. Finite State Machines. Circuits Gates. Transistors CSC258 Week 3 1 Logistics If you cannot login to MarkUs, email me your UTORID and name. Check lab marks on MarkUs, if it s recorded wrong, contact Larry within a week after the lab. Quiz 1 average: 86%

More information

Uncertain Compression & Graph Coloring. Madhu Sudan Harvard

Uncertain Compression & Graph Coloring. Madhu Sudan Harvard Uncertain Compression & Graph Coloring Madhu Sudan Harvard Based on joint works with: (1) Adam Kalai (MSR), Sanjeev Khanna (U.Penn), Brendan Juba (WUStL) (2) Elad Haramaty (Harvard) (3) Badih Ghazi (MIT),

More information

General Strong Polarization

General Strong Polarization General Strong Polarization Madhu Sudan Harvard University Joint work with Jaroslaw Blasiok (Harvard), Venkatesan Gurswami (CMU), Preetum Nakkiran (Harvard) and Atri Rudra (Buffalo) December 4, 2017 IAS:

More information

ELEN Electronique numérique

ELEN Electronique numérique ELEN0040 - Electronique numérique Patricia ROUSSEAUX Année académique 2014-2015 CHAPITRE 3 Combinational Logic Circuits ELEN0040 3-4 1 Combinational Functional Blocks 1.1 Rudimentary Functions 1.2 Functions

More information

Math 3336 Section 4.3 Primes and Greatest Common Divisors. Prime Numbers and their Properties Conjectures and Open Problems About Primes

Math 3336 Section 4.3 Primes and Greatest Common Divisors. Prime Numbers and their Properties Conjectures and Open Problems About Primes Math 3336 Section 4.3 Primes and Greatest Common Divisors Prime Numbers and their Properties Conjectures and Open Problems About Primes Greatest Common Divisors and Least Common Multiples The Euclidian

More information