EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

ICS312 Set 2 Representation of Numbers and Characters.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Data Representation in Computers
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
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.
Binary Numbers.
Binary Number Systems.
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Dr. Bernard Chen Ph.D. University of Central Arkansas
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Computers Organization & Assembly Language
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Number Systems Spring Semester 2013Programming and Data Structure1.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
ICS312 Set 1 Representation of Numbers and Characters.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
1 Digital Design: Number Systems Credits : Slides adapted from: J.F. Wakerly, Digital Design, 4/e, Prentice Hall, 2006 C.H. Roth, Fundamentals of Logic.
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
The Hexadecimal Number System and Memory Addressing ISAT 121.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
AEEE2031 Data Representation and Numbering Systems.
WEEK #2 NUMBER SYSTEMS, OPERATION & CODES (PART 1)
Number Systems by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Computer Number System
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Data Representation COE 301 Computer Organization Dr. Muhamed Mudawar
Fall’ 2014 Lesson - 1 Number System & Program Design CSE 101.
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
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.
Data Representation COE 308 Computer Architecture
Programming and Data Structure
Number Systems and Codes
NUMBER SYSTEMS.
Data Representation ICS 233
Lec 3: Data Representation
Data Representation.
Number Representation
Data Representation Binary Numbers Binary Addition
CSCI 198: Lecture 4: Data Representation
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 : INTRODUCTION
CSCI 161: Lecture 4: Data Representation
Number Systems.
Chapter 3 Data Representation
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Data Representation COE 301 Computer Organization
Data Representation Data Types Complements Fixed Point Representation
MMNSS COLLEGE,KOTTIYAM DEPARTMENT OF PHYSICS
Numbering System TODAY AND TOMORROW 11th Edition
Chapter Four Data Representation in Computers By Bezawit E.
Data Representation ICS 233
UNIT – 3 & 4. Data Representation and Internal
Data Representation COE 308 Computer Architecture
Presentation transcript:

EX_01.1/46 Numeric Systems

EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.3/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.4/46 Numeric systems – General … A numeric system consists of an ordered set of symbols, called digits, with relations defined for addition, subtraction, multiplication, and division, † < ¿ < Ä < ¤ < Æ < § < ₣ < ‡ < † < ® Example: §Ä‡ †® + Æ® †® = §‡‡ †®, The problem is that we use in different systems the very same symbols, The base, of a number system, is the total number of digits allowed in the number system.

EX_01.5/46 Numeric systems – General (Cont’d) … The most common number systems used in digital system design and computer programming are binary, decimal, hexadecimal and octal, Computer’s information is coded in the shape of on or off bits; (1 and 0), this way of codifying takes us to the necessity of knowing the positional calculation which will allow us to express a number in any base where we need it.

EX_01.6/46 Numeric systems – General (Cont’d) … It is possible to represent a determined number in any base through the following formula: Where: n is the position of the digit beginning from right (position 0) to left and numbering from zero. D is the digit on which we operate and B is the used numeric base.

EX_01.7/46 Numeric systems – General (Cont’d) Example of Positional Number System: = 1* * * *1 0, = 1* * *10 + 4*1, Here 10 is the base, or radix, of the number system, The value of the number is the sum of each digit multiplied by the corresponding power of the radix.

EX_01.8/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.9/46 Binary Numbers … Digital systems are usually constructed using two- state devices that are either in an off state or an on state, Therefore, the binary number system is perfect for representing numbers in digital systems (since only two digits, 0 and 1, are needed), A single bit can be stored in a two-state storage device often called a latch, Binary numbers of length n can be stored in an n-bit long device known as a register.

EX_01.10/46 Binary Numbers (Cont’d) … The digits: {0, 1} Examples: , , 0 2, 11 2, (28, ) MSB – Most Significant Bit, LSB – Least Significant Bit, MSB LSB

EX_01.11/46 Binary Numbers (Cont’d) … Binary to Decimal Conversion Method: Summation: Σ, Convert (Binary) to Base 10, … (Decimal): 1* * * * *2 4 (Decimal): 1*1 + 1*2 + 0*4 + 1*8 + 1*16 =

EX_01.12/46 Binary Numbers (Cont’d) … Another Example: Convert (Binary) to Base 10, … (Decimal): 1* * *2 2 +1*23 + 1* * * * * * *2 10 = (Decimal): 1*1 + 0*2 + 0*4 + 1*8 + 1*16 + 0*32 + 1*64 + 1* * * *1024 =

EX_01.13/46 Binary Numbers (Cont’d) … Decimal to Binary Conversion Method: Use the successive division of two, keeping the residue as a binary digit and the result as the next number to divide. Let us take for example the decimal number of /2 = 21 and its residue is 1 (LSB), 21/2 = 10 and its residue is 1, 10/2 = 5 and its residue is 0, 5/2 = 2 and its residue is 1, 2/2 = 1 and its residue is 0, 1/2 = 0 and its residue is 1 (MSB), The binary result is

EX_01.14/46 Binary Numbers (Cont’d) … Decimal to Binary Conversion Method: Division Convert (Decimal) to Base 2 (Binary): … 108/2 = 54 and remainder 0 (LSB), 54/2 = 27 and remainder 0, 27/2 = 13 and remainder 1, 13/2 = 6 and remainder 1, 6/2 = 3 and remainder 0, 3/2 = 1 and remainder 1, 1/2 = 0 and remainder 1 (MSB), Result:

EX_01.15/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.16/46 Octal Numbers … The digits: {0, 1, 2, 3, 4, 5, 6, 7}, Examples: , , , Octal to Decimal Conversion Method: Summation Σ, Convert (Octal) to Base 10 (Decimal): … 4* * * *8 3 + = 4*1 + 3*8 + 2*64 + 1*512 =

EX_01.17/46 Octal Numbers … (Cont’d) Decimal to Octal Conversion Method: Division, Convert (Decimal) to Base 8 (Octal): … 108/8 = 13 and remainder 4 (LSB), 13/8 = 1 and remainder 5, 1/8 = 0 and remainder 1 (MSB), Result:

EX_01.18/46 Octal Numbers … (Cont’d) Octal to Binary Conversion Method: Substitution, Substitute any octal digit with three binary digits. 0 8 = = = = = = = = 111 2, Convert (Octal) to Base 2 (Binary): … ,

EX_01.19/46 Octal Numbers (Cont’d) Binary to Octal Conversion Method: Substitution, Convert (Binary) to Base 8 (Octal): … , , Result:

EX_01.20/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.21/46 Hexadecimal Numbers … The digits: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F}, On the hexadecimal base we have 16 digits which go from 0 to 9 and from the letter A to the F, these letters represent the numbers from 10 to 15. Thus we count 0 16, 1 16, 2 16, 3 16, 4 16, 5 16, 6 16, 7 16, 8 16, 9 16, A 16, B 16, C 16, D 16, E 16, F 16 and 10 16, Examples: 890A 16, CC02FFE 16, 12B 16, B12 16, 0 16, 12 16, A2 16, 3FF0E7071A9 16.

EX_01.22/46 Hexadecimal Numbers (Cont’d) … DecBinaryOctHex DecBinaryOctHex A B C D E F

EX_01.23/46 Hexadecimal Numbers (Cont’d) … Hexadecimal to Decimal Conversion Method: Summation Σ, Convert C0DE 16 (HEX) to Base 10 … (Decimal) 14* * * *16 3 = (Decimal): 14*1 + 13*16 + 0* *4096 =

EX_01.24/46 Hexadecimal Numbers (Cont’d) … Decimal to Hexadecimal Conversion Method: Division, Convert (Decimal) to Base 16 (HEX): … 108/16 = 6 and remainder 12 (which is C 16 ) (LSB) 6/16 = 0 and remainder 6 (MSB) Result: 6C 16.

EX_01.25/46 Hexadecimal Numbers (Cont’d) … Hexadecimal to Binary Conversion Method: Substitution, Convert FFCE (Hex) to Binary16, … 7FCEE55 16 = =

EX_01.26/46 Hexadecimal Numbers … (Cont’d) Binary to Hexadecimal Conversion Method: Substitution, Convert (Binary) to Base 16, … = = 5D9 16.

EX_01.27/46 Hexadecimal Numbers (Cont’d) … Hexadecimal to Octal Conversion Method: Substitution (via binary), Convert C0DE 16 (HEX) to Base 8, … C0DE 16 = = = , Added leading 0s

EX_01.28/46 Conversion Methods Diagram Division / 16 Substitution Division / 8 Substitution Division / 2

EX_01.29/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.30/46 Data Units … In the computer memory we locate our data. The data may be: Bit wide (that is 1 or 0), 0 2 in a bit we can hold either 0 2 or 1 2, Nibble - 4 bits wide, in a nibble we can hold numbers from 0 2 to that is from 0 to 15 10, Byte is 8 bits wide, – , that is 0 to

EX_01.31/46 Data Units (Cont’d) Word is 16 bits wide, – that is 0 – 65,535 10, Double Word is 32 bits wide – that is 0 – 4,294,967,295 10, Notice: all these are positive numbers, we haven’t touch yet any negative number.

EX_01.32/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.33/46 ASCII Code … ASCII is an acronym of American Standard Code for Information Interchange, This code assigns the letters of the alphabet, decimal digits from 0 to 9 and some additional symbols a binary number of 7 bits, putting the 8th bit in its off state or 0, For example: Space has the ASCII code of 30 16, that is , ‘A’ has the ASCII code of 41 16, that is , ‘0’ has the ASCII code of 30 16, that is

EX_01.34/46 ASCII Code (Cont’d) … This way each letter, digit or special character occupies one byte in the computer memory, ASCII is very inefficient on the numeric aspect, since in binary format one byte is enough to represent numbers from 0 to 255, but on the other hand with the ASCII code one byte may represent only one digit. Due to this inefficiency, the ASCII code is mainly used in the memory to represent text.

EX_01.35/46 ASCII Code (Cont’d) …

EX_01.36/46 ASCII Code (Cont’d) …

EX_01.37/46 ASCII Code (Cont’d) Translate the following: 48656C6C6F20576F726C , … Hello World!

EX_01.38/46 Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.39/46 Negative number’s representation … So far we have seen only positive (and 0) numbers, How can we represent negative numbers in computers?

EX_01.40/46 Neg. Num: 2’s complement The 2’complemet method: In this method the first bit is the sign…, but serves as part of the number as well.

EX_01.41/46 The 2’complement Notation (Cont’d) … In order to achieve the 2’complemet representation of a number, do the following: A. Invert all the digits, that is 0 ->1, and 1-> 0. Example: > (1’complemet), B. Add 1 to the result. Example = , That is is the 2’complemet of

EX_01.42/46 The 2’complement Notation (Cont’d) … Compute – (45 10 – ), We will do this by adding ’complement! Lets change to its 2’complement, A > (1’complemet), B = (2’complemet), Now let us sum these two numbers: : , that is Carry

EX_01.43/46 The 2’complement Notation (Cont’d) … What is the 2’complemet of a 2’complemet? Example: (53 10 ) First 2’complemet: A > (1’complemet), B = (2’complemet), Second 2’complement: A > (1’complemet), = (2’complemet),

EX_01.44/46 The 2’complement Notation (Cont’d) With n bits you can represent the numbers from –2 n-1 to +2 n-1 -1, -1 is a string of 1s, Zero is a string of 0s, (what is his 2’complemet?), –2 n is 1 and the rest 0s, +2 n is invalid, unless you move to a larger register (i.e. a representation of a larger size).

EX_01.45/46 Summary Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code, Negative number’s representation.

EX_01.46/46 Numeric Systems The End.