WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
Chapter 1 Digital Systems and Numbers System
CHAPTER 2 Number Systems, Operations, and Codes
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
ECE 331 – Digital System Design
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Number Systems and Arithmetic
© Copyright 2000 Indiana University Board of Trustees Proficiency Quiz Study Guide Note: The following slides are provided courtesy of Dr. Bob Orr (Computer.
1 Lecture 2: Number Systems Binary numbers Base conversion Arithmetic Number systems  Sign and magnitude  Ones-complement  Twos-complement Binary-coded.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
Data Representation – Binary Numbers
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
BINARY ARITHMETIC Binary arithmetic is essential in all digital computers and in many other types of digital systems.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Number systems: binary, decimal, hexadecimal and octal. Conversion between various number systems Number systems: binary, decimal, hexadecimal and octal.
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
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.
Number systems, Operations, and Codes
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
1 IT 231, CMPE 331 Digital Logic Design Week 2 Number systems and arithmetic.
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
AEEE2031 Data Representation and Numbering Systems.
Number Systems & Operations
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
Introduction To Number Systems Binary System M. AL-Towaileb1.
School of Computer and Communication Engineering, UniMAP Mohd ridzuan mohd nor DKT 122/3 - DIGITAL SYSTEM I Chapter.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
CPEN Digital Logic Design Binary Systems Spring 2004 C. Gerousis © Digital Design 3 rd Ed., Mano Prentice Hall.
Introduction to Digital Electronics Lecture 2: Number Systems.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
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.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Fall’ 2014 Number System CSE Number System How Computers Represent Data Binary Numbers The Binary Number System Bits and Bytes Text Codes Binary.
CPE 201 Digital Design Lecture 2: Digital Systems & Binary Numbers (2)
Introduction To Number Systems
Digital Design Chapter One Digital Systems and Binary Numbers
Numbering Systems.
Number Systems and Binary Arithmetic
CHAPTER 1 INTRODUCTION TO DIGITAL LOGIC
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Number Systems.
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
SYEN 3330 Digital Systems Chapter 1 SYEN 3330 Digital Systems.
Number Systems and Binary Arithmetic
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Binary to Decimal Conversion
Presentation transcript:

WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1) DKT 122/3 DIGITAL SYSTEM 1 WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)

Numbers & Codes Numbering Systems Number Conversion Binary Arithmetic Decimal numbering system (Base 10) Binary numbering system (Base 2) Hexadecimal numbering system (Base 16) Octal numbering system (Base 8) Number Conversion Binary Arithmetic 1’s and 2’s Complements of Binary Numbers

Numbers & Codes (cont..) Signed Numbers Other Number Codes Arithmetic Operations with Signed Numbers Other Number Codes Binary-Coded-Decimal (BCD) ASCII codes Gray codes Digital Codes & Parity

Numbering Systems Decimal Binary Octal Hexadecimal 0 ~ 9 0 ~ 1 0 ~ 7 (base 10) Binary (base 2) Octal (base 8) Hexadecimal (base 16) 0 ~ 9 0 ~ 1 0 ~ 7 0 ~ F

Num. Systems (Characteristics) The digits are consecutive (berturutan). The number of digits is equal to the size of the base. Zero is always the first digit. When 1 is added to the largest digit, a sum of zero and a carry of one results. Numeric values determined by the implicit positional values of the digits.

Numbering Systems (Cont.) 00000000 00000001 00000010 00000011 00000100 00000101 00000110 00000111 00001000 00001001 00001010 00001011 00001100 00001101 00001110 00001111 000 001 002 003 004 005 006 007 010 011 012 013 014 015 016 017 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 Binary Octal Hex Dec

Numbering System (Decimal) Also called the Base 10 system Have 10 digits : 0  9 The position for each digit in the decimal number indicates the magnitude of the quantity represented and can be assigned a weight

Numbering System (Decimal) The weight for whole numbers are positive powers of ten that increase from right to left 105 104 103 102 101 100 For fractional numbers, the weights are negative powers of ten that decrease from left to right 102 101 100 . 10-1 10-2 10-3…. Decimal point

Numbering System (Binary) Also called the Base 2 system The binary number system is used to model the series of electrical signals computers use to represent information 0 represents the no voltage or an off state 1 represents the presence of voltage or an on state

“There are 10 kinds of mathematicians. Just think for a while.. “There are 10 kinds of mathematicians. Those who can think binarily and those who can't...” So, what is the meaning of this? YOU FALL IN WHICH CATEGORY?

Significant Digits Binary: 11101101 Hexadecimal: 1D63A72A Most significant digit (MSB) Least significant digit (LSB) Hexadecimal: 1D63A72A Question: How many bits does the numbers represent?

Number Conversion Any Radix (base) to Decimal Conversion

Binary to Decimal Conversion Decimal value of any binary number can be found by adding weights of all bits that are 1 and discarding the weights of all bits that are 0

Solve this.. Convert the following binary numbers to decimal (a) 10102 Answer : ? (b) 101112 Answer : ? (c) 10101102 Answer : ?

Decimal to Binary Conversion For whole number conversion, use the repeated division-by-2 process and record the remainder For fractional number conversion, use repeated multiplication by 2 until the fractional product is 0 or until the desired number of decimal places is reached

Decimal to Binary Conversion Remainder Whole number 2 5 = 12 + 1 2 1 2 = 6 + 0 6 = 3 + 0 3 = 1 + 1 1 = 0 + 1 2 MSB LSB 2510 = 1 1 0 0 1 2

Decimal to Binary Conversion Fractional number Carry . 0 1 0 1 0.3125 x 2 = 0.625 0 0.625 x 2 = 1.25 1 0.25 x 2 = 0.50 0 0.5 x 2 = 1.00 1 The Answer: 1 1 0 0 1.0 1 0 1 MSB LSB

Solve this.. Convert the following decimal numbers to binary (a) 3910 Answer : ? (b) 5810 Answer : ? (c) 0.37510 Answer : ?

Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division

Binary Addition Four basic rules for adding binary digits (bits) are: 0 + 0 = 0 (Sum of 0 with a carry of 0) 0 + 1 = 1 (Sum of 1 with a carry of 0) 1 + 0 = 1 (Sum of 1 with a carry of 0) 1 + 1 = 1 0 (Sum of 0 with a carry of 1)

Examples (a) 100 + 10 1 0 0 + 1 0 (Answer) 1 1 0 (b) 111 + 11 1 1 1 + Perform the following binary additions: (a) 100 + 10 1 0 0 1 0 + 1 1 0 (Answer) (b) 111 + 11 1 1 1 + 1 1 (Answer) 1 0 1 0

Solve this.. Perform the following binary additions: (a) 11 + 01 Answer : ? (b) 111 + 110 Answer : ? (c) 1001 + 101: Answer : ?

Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division

Binary Subtraction 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 Four basic rules for subtracting binary digits (bits) are: 0 - 0 = 0 1 - 1 = 0 1 - 0 = 1 1 0 - 1 = 1 (0 – 1 with a borrow of 1)

Examples (a) 101 – 011 1 0 1 - 0 1 1 (Answer) 0 1 0 (b) 110 – 101 Perform the following binary subtractions: (a) 101 – 011 1 0 1 0 1 1 - 0 1 0 (Answer) (b) 110 – 101 1 1 0 1 0 1 - 0 0 1 (Answer)

Solve this.. (a) 101 – 100 (b) 1110 - 11 (c) 1100 - 1001: Perform the following binary subtractions (a) 101 – 100 Answer : ? (b) 1110 - 11 Answer : ? (c) 1100 - 1001: Answer : ?

Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division

Binary Multiplication Four basic rules for muliplying binary digits (bits) are: 0 x 0 = 0 0 x 1 = 0 1 x 0 = 0 1 x 1 = 1

Examples Multiply 111 and 101: 1 1 1 x 1 0 1 1 1 1 0 0 0 1 1 1 (Answer)

Solve this.. (a) 11 x 11: (b) 110 x 111: (c) 1101 x 1010: Answer : ?

Binary Arithmetics Binary Addition Binary Subtraction Binary Multiplication Binary Division

Binary Division Example: 1 0 (Answer) 1 1 1 1 0 1 1 0 0 0 Division in binary follows the same procedure as division in decimal Example: Perform the binary divisions of 110  11 1 0 (Answer) 1 1 1 1 0 1 1 0 0 0

Solve this.. Divide the binary numbers as indicated: (a) 100  10 Answer : ? (b) 1100  100: Answer : ?

1’s Complement Example: 1 1 0 1 0 0 1 0 1 Binary number Changing all the 1s to 0s and all the 0s to 1s Example: 1 1 0 1 0 0 1 0 1 Binary number 0 0 1 0 1 1 0 1 0 1’s complement

Find the 1’s complements of the numbers Step 1: Find the 1’s complements of the numbers 1 1 1 0 1 0 1 0 1 Binary number 0 0 0 1 0 1 0 1 0 1’s complement Step 2: Add ‘1’ to the 1’s complements 0 0 0 1 0 1 0 1 0 1’s complement + 1 Add 1 0 0 0 1 0 1 0 1 1 2’s complement

Solve this.. Determine the 2’s complement of each binary number: (a) 00010110 Answer : ? (b) 10010001 Answer : ?

Signed Numbers Left most is the sign bit 0 is for positive, 1 is for negative Sign & magnitude 00011001 = +25 sign bit magnitude bits

Sign-Magnitude Numbers The left-most is the sign bit and the remaining bits are the magnitude bits 0110010.. …00101110010101 Sign bit 31 bits for magnitude 0 = positive 1 = negative

Signed Numbers (Cont.) 1’s complement The negative number is the 1’s complement of the corresponding positive number Example +25 is 00011001 So, -25 is 11100110 2’s complement The positive number – same as sign magnitude and 1’s complement The negative number is the 2’s complement of the corresponding positive number. +25 is 00011001 So, -25 is 11100111

END Solve this.. Express +19 and -19 (as an 8-bit number) in i. sign magnitude ii. 1’s complement iii. 2’s complement Answer : ? Answer : ? Answer : ? END