Number systems and codes

Slides:



Advertisements
Similar presentations
ECE 331 – Digital System Design
Advertisements

NUMBER SYSTEM. How to convert hexadecimal numbers to decimal numbers? 230 Working from right to left, MULTIPLY each position with 8 raised to the power.
Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
DATA REPRESENTATION CONVERSION.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Lecture 3 Number System.
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
Numbers. Number Conversion Convert – Binary number to decimal numbers – Octal numbers to decimal numbers – Hexadecimal to decimal numbers Convert – Decimal.
CMPE12cGabriel Hugh Elkaim 1 Number Systems. CMPE12cGabriel Hugh Elkaim 2 A Brief History of Numbers From Gonick, Cartoon Guide to Computer Science.
ECE 301 – Digital Electronics Course Introduction, Number Systems, Conversion between Bases, and Basic Binary Arithmetic (Lecture #1)
ECE 331 – Digital System Design
Number System Conversions Lecture L2.2 Section 2.3.
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Converting Binary to Octal
Number Systems and Arithmetic
BASICS OF COMPUTER APPLICATIONS ASB 102. UNIT 1 Introducing computer system  Number system  What is number system?  Types of number system  Their.
Hexadecimal Dk Izzati Pg Haji Ahmad.
Number Systems.
Number Systems - Part II
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Supplemental Chapter Number Bases
NUMBER SYSTEM.
Number Systems Ron Christensen CIS 121.
Integer Representation for People Computer Organization and Assembly Language: Module 3.
CMPE12c Fall 03Cyrus BazeghiCMPE12c Fall 03Cyrus Bazeghi 1 Number Systems.
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
Number systems, Operations, and Codes
CPS120: Introduction to Computer Science Computer Math: Converting to Decimal.
Number Base Conversions
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
NUMBER SYSTEM. Number System Number Base B => B symbols – Base 16(Hexa):0, 1,……9, A,…, E, F – Base 10 (Decimal): 0, 1, 2,……, 7, 8, 9 – Base 8(Octal):
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
Arithmetic Chapter 4 Subject: Digital System Year: 2009.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
Chapter 5 NUMBER REPRESENTATION AND ARITHMETIC CIRCUITS.
1 Digital Logic Design (41-135) Chapter 5 Number Representation & Arithmetic Circuits Younglok Kim Dept. of Electrical Engineering Sogang University Spring.
Dr. Nermin Hamza 1. Materials Book: Digital Design 4 th M. Morris Mano and Michael D. Ciletti 2.
Coding Part 2. Weight of the Digit 3672 Thousands (10 3 )Hundreds (10 2 )Tens (10 1 )Units (1) = Weights Decimal Example (3672) 10 Binary.
Chapter 2 Binary Number Systems.
Introduction To Number Systems
Positional Number Systems Decimal, Binary, Octal and Hexadecimal Numbers Wakerly Section
Digital Design Chapter One Digital Systems and Binary Numbers
Positional Notation A positional or place-value notation is a numeral system in which each position is related to the next by a constant multiplier, called.
Lecture 3: Binary values and number systems
CHAPTER 1 : INTRODUCTION
Number System Submitted by: Submitted to: Devashish Bhardwaj Miss.Hina
Number Systems.
Number Systems Lab session 1 Xuan Guo.
Chapter 3 Data Representation
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Number System conversions
Overview Introduction Data representation Fixed Point Representation
Binary Quiz UIN: ____________________
Number Systems and Binary Arithmetic
Binary, Octal and Hex Numbers Copyright Thaddeus Konar
EGRE 254 Number Systems and Codes 1/12/09
Digital Electronics Ms. Deepa Mehta.
EEL 3705 / 3705L Digital Logic Design
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
There are 10 types of people of people in this world…
Digital Logic Design (CSNB163)
ECE 301 – Digital Electronics
Number Systems Rayat Shikshan Sanstha’s
Numeral systems (radix)
Storing Integers and Fractions
Number Systems Rayat Shikshan Sanstha’s
Remember the 10 types of people of people in this world…
Computer Science 1 Review and finish Number base conversion
Information Representation
Presentation transcript:

Number systems and codes Ordered set of symbols or digits, with defined relations for +    Radix (base) r Total # of symbols allowed in system Decimal: 10 digits {0…9}; radix = 10 Binary: 2 digits {0, 1}; radix = 2

Number systems and codes Positional notation N = (an-1 an-2 --- a0 . a-1 --- a-m) Algebraic value of N = ? N1 = (1357.46)10 N1 evaluated as ?

Number systems and codes N = a polynomial of radix r For radix r, digit set is = {0, --- ?} Hexadecimal r = 16 Digit set = {0, --- ?} Why has arithmetic evolved around radix 10? Which radix do you think is the “most efficient”?

3500 BC, Egyptians, nonpositional 2500 BC, Sumerians, positional, base 60 Today:

Numeric conversions binary to octal: 10111011001 --> 10 111 011 001 --> 2731 (substitution) binary to hex: 10111011001 --> 101 1101 1001 --> 5D9 (substitution) binary to decimal: 10111011001 --> 1 (1024) + 0 (512) + 1 (256) + 1 (128) + 1 (64) + 0 (32) + 1 (16) + 1 (8) + 0 (4) + 0 (2) + 1 (1) = 1497 (summation) hex to binary: 5D9 --> 0101 1101 1001 --> 10111011001 (substitution) hex to octal: 5D9 --> 0101 1101 1001 --> 010 111 011 001 --> 2731 (substitution) hex to decimal: 5D9 --> 5 (256) + 13 (16) + 9 (1) = 1497 (summation) octal to binary: 2731 --> 010 111 011 001 --> 10111011001 (substitution) octal to hex: 2731 --> 010 111 011 001 --> 0101 1101 1001 -> 5D9 (substitution) octal to decimal: 2731 --> 2 (512) + 7 (64) + 3 (8) + 1 (1) = 1497 (summation)

Base conversions (10111)2 = (?)10 20 + 21 + 22 + 24 = 23 (274)8 = (?)10 (A)rS = (?)rD

Base conversions If source radix rS < destination radix rD then Every digit in the source number system is also a digit in the destination number system: simply evaluate polynomial in destination number system If source radix rS > destination radix rD (97)10 = ( ? )2 N = dn-1rSn-1 + …+d0rS0 = yp-1rDp-1 + …+y0rD0 Q: How do we find the yp-1…y0 coefficients?

} Base conversions Q1 N = (yp-1rDp-2 + …+ y1)•rD + y0  N modulo rD = y0 Q1 modulo rD = y1 Q2 modulo rD = y2 ……………………… When do we stop?

Base conversions Division is expensive. Q = N; i = 0; While (Q  0) do digit [ i ] = Q mod rD Q = Q/rD End-while Division is expensive. Question: is there a way to avoid division (replace it with +, ,  and possibly some table lookups?

Converting fractions } } f = d-1rS-1 + d-2rS-2 + … = y-1rD-1 + y-2rD-2 + … f•rD = y-1 + y-2rD-1 Integer fractional  f•rD = y-1 n = floor f1•rD = y-2 .................. When do we stop? } }