1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.

Slides:



Advertisements
Similar presentations
ECE 331 – Digital System Design
Advertisements

Number Bases Informatics INFO I101 February 9, 2004 John C. Paolillo, Instructor.
DATA REPRESENTATION CONVERSION.
HEXADECIMAL NUMBERS Code
Binary Arithmetic Binary addition Binary subtraction
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Assembly Language and Computer Architecture Using C++ and Java
Level ISA3: Information Representation
Assembly Language and Computer Architecture Using C++ and Java
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
ECE 331 – Digital System Design
ECE 301 – Digital Electronics Number Systems and Conversion, Binary Arithmetic, and Representation of Negative Numbers (Lecture #10) The slides included.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Mantıksal Tasarım – BBM231 M. Önder Efe
1 Computer Fundamental ITD1382 Coursework : 100% 1. Tests 2. Quizzes (Short) 3. Assignments Module Value : 3.0.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Data Representation – Binary Numbers
Digital Design: From Gates to Intelligent Machines
Chapter 6 Digital Arithmetic: Operations and Circuits ECE 221 Intro
Logic and Digital System Design - CS 303
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Number Systems. Why binary numbers? Digital systems process information in binary form. That is using 0s and 1s (LOW and HIGH, 0v and 5v). Digital designer.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
IT101: INFORMATION TECHNOLOGY FUNDAMENTALS 1 Edited By Dr. Ahmed Abo-Bakr Information Technology Dept. Faculty of Computers & Information.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
Number Systems ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
IKI Data Types & Representations Bobby Nazief Semester-I The materials on these slides are adopted from those in CS231’s Lecture Notes.
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
ECE 331 – Digital System Design
1 EENG 2710 Chapter 1 Number Systems and Codes. 2 Chapter 1 Homework 1.1c, 1.2c, 1.3c, 1.4e, 1.5e, 1.6c, 1.7e, 1.8a, 1.9a, 1.10b, 1.13a, 1.19.
1 Boolean Logic & Number Systems Today: Some Announcements First Hour: Introduction to Logic –Section 1.2, 1.3 of Katz’s Textbook –In-class Activity #1.
Topic 1 – Number Systems. What is a Number System? A number system consists of an ordered set of symbols (digits) with relations defined for addition,
Operations on Bits Arithmetic Operations Logic Operations
Computer Math CPS120: Lecture 3. Binary computers have storage units called binary digits or bits: Low Voltage = 0 High Voltage = 1 all bits have 0 or.
Data Representation, Number Systems and Base Conversions
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Computer Math CPS120 Introduction to Computer Science Lecture 4.
AEEE2031 Data Representation and Numbering Systems.
Lecture 2 Binary Arithmetic Topics Terminology Fractions Base-r to decimal Unsigned Integers Signed magnitude Two’s complement August 26, 2003 CSCE 211.
1 CS151 Introduction to Digital Design Chapter 1 Lecture 3.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Unit - 3 NUMBER SYSTEM AND CODES
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
Number Representation (Part 2) Computer Architecture (Fall 2006)
CPS120: Introduction to Computer Science Computer Math: Addition and Subtraction.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
Computer Math CPS120 Introduction to Computer Science Lecture 7.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Chapter 6. Digital Arithmetic: Operations and Circuits
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
CPE 201 Digital Design Lecture 2: Digital Systems & Binary Numbers (2)
1 Arithmetic Building Blocks Today: Signed ArithmeticFirst Hour: Signed Arithmetic –Section 5.1 of Katz’s Textbook –In-class Activity #1 Second Hour: Adder.
Digital Systems and Number Systems
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Number System Submitted by: Submitted to: Devashish Bhardwaj Miss.Hina
CSE 102 Introduction to Computer Engineering
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
Data Representation in Computer Systems
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
ECE 301 – Digital Electronics
Introduction To Number Systems
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems

2 Uses 10 digits [ 0, 1, 2,... 9 ] Decimal Numbers In general: N =  N i x 10 i where N i  [0, 1, 2,...8, 9], where N i are the weights and the base of the number System, i.e., 10, is raised to the exponent i. Note: decimal fractions occur when i is negative 0.35 = 3 x x In general: N =  N i x 10 i where N i  [0, 1, 2,...8, 9], where N i are the weights and the base of the number System, i.e., 10, is raised to the exponent i. Note: decimal fractions occur when i is negative 0.35 = 3 x x Positional Number Notation Weight of digit determined by its position. Positional Number Notation Weight of digit determined by its position. Example: 246= = 2 x x x 10 0

3 Binary Numbers Uses 2 digits [ 0 & 1 ] Example: = = 1 x x x x x x 2 0 = 1 x x x x x x 1 = In general: N =  N i x 2 i where N i  [0, 1]. Note: binary fractions occur when i is negative = 1x x 2 -2 = = In general: N =  N i x 2 i where N i  [0, 1]. Note: binary fractions occur when i is negative = 1x x 2 -2 = = Positional Number Notation

4 Hexadecimal (Hex) Numbers Example: 89AB 16 = A B 16 = 8 x x A x B x 16 0 = 8 x x x x 1 = Uses 16 digits [ 0, 1, 2,... 9, A, B, C, D, E, F ] In general: N =  N i x 16 i where N i  [0, 1, 2,..., 9, A, B, C, D, E, F]. Note: hexadecimal fractions occur when i is negative 0.9A 16 = 9 x x = = In general: N =  N i x 16 i where N i  [0, 1, 2,..., 9, A, B, C, D, E, F]. Note: hexadecimal fractions occur when i is negative 0.9A 16 = 9 x x = = Note: A - F represent the decimal values of , respectively. Positional Number Notation

5 Conversion Among Bases In general, with positional number notation and the known decimal weights for each position in any arbitrary base, it is easiest to convert other bases to decimal. This was demonstrated in each previous example where the decimal value was found using the equation for base B:  N i x B i where N i  [0, 1, 2,..., B-1] and substituting the equivalent decimal weight for the digits N i and the decimal value of B i. Conversion among the 2 n bases (binary, hexadecimal, octal, etc.) is most easily achieved by first converting to binary, regrouping into n bits (starting at the base point) and then converting the groups of bits into the proper digits.

6 Memorize this table!!! It makes conversions between hexadecimal and binary trivial Hexadecimal  Binary HexBinaryDecimal A B C D E F HexBinaryDecimal A B C D E F Example: convert  hexadecimal Group by 4s, starting at the right  expand into 4 bit groups  C D 16 Example: convert  hexadecimal Group by 4s, starting at the right  expand into 4 bit groups  C D 16

7 Decimal  Binary Example: 57  2 =28,remainder = 1 (binary number will end with 1) 28  2 =14,remainder = 0 14  2 =7,remainder = 0 7  2 =3,remainder = 1 3  2 =1,remainder = 1 1  2 =0,remainder = 1 (binary number will start with 1) Therefore, collecting the remainders, = (((((0x2 + 1)x2 + 1)x2 + 1)x2 +0)x2 +0)x2 +1 = 1x32 + 1x16 + 1x8 + 0x4 + 0x2 + 1x1 = 57 (check: = 57) Based on the remainders after dividing the decimal number by higher powers of 2. If the decimal number is even, the corresponding binary number will end in a 0, and if it is odd, the binary number will end in a 1, and so on. Based on the remainders after dividing the decimal number by higher powers of 2. If the decimal number is even, the corresponding binary number will end in a 0, and if it is odd, the binary number will end in a 1, and so on. Successive Division: Successive Division: an easy way to convert Decimal to Binary

8 Decimal  Hex Example: / 16=2202,remainder = 11  B(hex number will end with B) 2202 / 16=137,remainder = 10  A 137 / 16=8,remainder = 9 8 / 16 =0, remainder = 8(hex number will start with 8) Therefore, collecting the remainders, = 89AB 16 (check: 8 x x x = 35243) Successive Division: Successive Division: an easy way to convert Decimal to Hexadecimal Based on the remainders after dividing the decimal number by higher powers of 16.

9 Hex  Decimal Example: BA89  B x A x x (CAUTION: mixed bases) = 11 x x x = = We can check by converting back to hex: / 16 = remainder, / 16 = remainder, / 16 = 11 + remainder, 10  A 11 / 16 = 0 + remainder, 11  B   BA89 16 Multiplication: Multiplication: an easy way to convert Hexadecimal to Decimal Multiply the hexadecimal weights by powers of 16.

10 Binary  Decimal Compare:  (exploiting the binary weights) = =  D6 16  13 x = = Multiplication: Multiplication: an easy way to convert Binary to Decimal We can multiple the binary weights by powers of 2. However, sometimes it is just as easy to convert the binary number to hexadecimal first and and then into decimal. We can multiple the binary weights by powers of 2. However, sometimes it is just as easy to convert the binary number to hexadecimal first and and then into decimal.

11 Computers have circuits that do binary arithmetic. You already know the rules for decimal addition and subtraction (how to handle sums, carries, differences, and borrows). Analogously, we develop the rules for binary addition and subtraction. Binary Arithmetic

x x x x x x  Decimal Addition Summary 11  Column carries Refresher = 1 x (0+1) x x 10 0

13 Binary Addition = = = = 0with a carry of = = = = 0with a carry of 1 This table calculates the sum for pairs of binary numbers Also know as the Half Adder Table

14 Binary Addition with Carry carry addend augend sum 0+0+0= = = =0with a carry of = =0 with a carry of =0 with a carry of =1with a carry of 1 carry addend augend sum 0+0+0= = = =0with a carry of = =0 with a carry of =0 with a carry of =1with a carry of 1 This table shows all the possible sums for binary numbers with carries Also known as the Full Adder Table

15 Binary Addition (carries) = = 3 10 = 8 10 Example: Add 5 and 3 in binary Similar to the decimal case

16 borrow = -1x = 9x x10 0 = 9x x = -1x x10 0 = -1x x x x10 0 Decimal Subtraction Note: borrows are shown as explicit subtractions. Refresher

17 Binary Subtraction = = 1 with a borrow of = = = = 1 with a borrow of = = 0 This table calculates the difference for pairs of binary numbers Also known as the Half Subtractor Table

18 Binary Subtraction with Borrow minuend subtrahend borrow difference 0-0-0= =1 with a borrow of =1with a borrow of =0with a borrow of = = = =1with a borrow of 1 minuend subtrahend borrow difference 0-0-0= =1 with a borrow of =1with a borrow of =0with a borrow of = = = =1with a borrow of 1 This shows all the possibile differences for binary numbers with borrows Also known as the Full Subtractor Table

19 Binary Subtraction = = =2 10 Similar to the decimal case Example: Subtract 3 from 5 in binary 0 -1 (borrows)

20 Number Systems Positive Positive numbers are same in most systems negative Major differences are in how negative numbers are represented Two major schemes: sign & magnitude two’s-complement For the examples assume a 4 bit machine word 16 different values can be represented roughly half are positive, half are negative Representation of Integers

21 Sign & Magnitude Representation Sign equals the High order bit:Sign equals the High order bit:0 = positive or zero (non-negative) 1 = negative Magnitude equals the three low order bits:Magnitude equals the three low order bits: 0 = 000 thru 7 = 111 n The number range =  7 for 4 bit numbers; for n bits,  2 n-1 -1 Two Representations for 0 (redundant & problematic) = = sign - sign 4 bit example

22 Sign & Magnitude (-3) Sign of the result: the same as the operands' sign (Don’t add sign bits) Operands have the same sign 4 + (-3) Sign of the result: the sign of operand with the larger magnitude Magnitude of the result: subtraction operation Operands have different signs Addition

23 Sign & Magnitude (-3) Sign of the result: the same as the operands' sign (Don’t subtract sign bits) Operands have the same sign 4 - (-3) Sign of the result: the sign of operand with the larger magnitude Magnitude of the result: addition operation Operands have different signs Subtraction

24

25

26