NUMBER SYSTEMS.

Slides:



Advertisements
Similar presentations
DATA REPRESENTATION CONVERSION.
Advertisements

EE1A2 Microprocessor Systems & Digital Logic Part I Digital Electronic System Design Dr. T. Collins.
Number Systems & Operations
2’s Complement Arithmetic (remember it’s a fixed length system)
Number Systems Discussion D4.1 Appendix C. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Decimal Addition What is going on? (carry) (subtract the base)
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
Binary, Decimal, & Hexadecimal Numbers
ITEC 352 Lecture 6 Back to binary. Binary Review Decoders 7 segment display Complexity of wiring Questions?
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
+ CS 325: CS Hardware and Software Organization and Architecture Integers and Arithmetic.
NEGATIVE BINARY NUMBER – Digital Circuit 1 Choopan Rattanapoka.
Hexadecimal Dk Izzati Pg Haji Ahmad.
Convert Decimal to Floating point number [IEEE 754]
Dr. Bernard Chen Ph.D. University of Central Arkansas
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
Number Systems Binary and Hexadecimal. Base 2 a.k.a. Binary  Binary works off of base of 2 instead of a base 10 like what we are taught in school 
Numeration Systems Introduction to Binary, Octal, and Hexadecimal.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Number Representation. 10/12/2015CDA31002 Conversion between Representations Now we can represent a quantity in different number representations How can.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
Representation of Data Ma King Man. Reference Text Book: Volume 2 Notes: Chapter 19.
ECEN 301Discussion #19 – Binary Numbers1 Numbered Moses 1:33,35,37 33 And worlds without number have I created; and I also created them for mine own purpose;
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,
Chapter 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
1 Week 2: Binary, Octal and Hexadecimal Numbers READING: Chapter 2.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Number systems, Operations, and Codes
Numbering System Base Conversion. Number systems Decimal – 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Binary – 0, 1 Octal – 0, 1, 2, 3, 4, 5, 6, 7 Hexadecimal system.
Positional Number Systems
Positional Notation 642 in base 10 positional notation is:
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Operations on Bits Arithmetic Operations Logic Operations
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
Number Systems and Logic Prepared by Dr P Marais (Modified by D Burford)
Hexadecimal. Overview Hexadecimal (hex) ~ base 16 number system Use 0 through 9 and... A = 10 B = 11 C = 12 D = 13 E = 14 F = 15.
CS 101 – Aug. 31 Interpreting binary  decimal √ Decimal  binary Shorthand ways of expressing binary –Octal –“Hex” Negative numbers.
Data Representation in Computer Systems. 2 Signed Integer Representation The conversions we have so far presented have involved only positive numbers.
Addition and Substraction
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
1 2.1 Introduction A bit is the most basic unit of information in a computer. –It is a state of “on” or “off” in a digital circuit. –Sometimes these states.
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.
1 4. Computer Maths and Logic 4.1 Number Systems.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
Introduction to Digital Electronics Lecture 2: Number Systems.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
Hexadecimal (base 16) BY MAT D. What is hexadecimal  Hexadecimal is a number system like binary or denary that has 16 characters, the numbers 0-9 and.
Lecture No. 4 Computer Logic Design. Negative Number Representation 3 Options –Sign-magnitude –One’s Complement –Two’s Complement  used in computers.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Numbering Systems and Conversion Understand How Computing Devices Work 1.
Data Types and Information Representation
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.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Lecturer: Santokh Singh
Discrete Mathematics Numbering System.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Chapter 3 Data Representation
Data Representation in Computer Systems
Arithmetic Operation By: Asst Lec. Besma Nazar Nadhem
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

NUMBER SYSTEMS

DEC BIN OCT HEX DEC BIN OCT HEX 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 10000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 1 2 3 4 5 6 7 8 9 A B C D E F 10 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 10001 10010 10011 10100 10101 10110 10111 11000 11001 11010 11011 11100 11101 11110 11111 100000 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 40 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20

CONVERSIONS FROM ONE BASE TO ANOTHER BASE

Decimal to Binary 9410 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 94/64 = 1R30 1 BASE TWO PLACE VALUE CHART | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 9410 94/64 = 1R30 1 30/32 = 0R30 0 30/16 = 1R14 1 14/8 = 1R6 1 6/4 = 1R2 1 2/2 = 1R0 1 0/1 = 0R0 0 9410 = 10111102

Decimal to Binary 7210 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 72/64 = 1R8 1 BASE TWO PLACE VALUE CHART | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 7210 72/64 = 1R8 1 8/32 = 0R8 0 8/16 = 0R8 0 8/8 = 1R0 1 0/4 = 0R0 0 0/2 = 0R0 0 0/1 = 0R0 0 7210 = 10010002

Decimal to Binary 5110 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 51/32 = 1R19 1 BASE TWO PLACE VALUE CHART | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 5110 51/32 = 1R19 1 19/16 = 1R3 1 3/8 = 0R3 0 3/4 = 0R3 0 3/2 = 1R1 1 1/1 = 1R0 1 5110 = 1100112

BINARY TO DECIMAL Simply add up the binary place values where there is a one. Try it out on the last three slides and see how it works. Try converting the following 11101002 1010112 110100102 100111102 Base two place value chart | 256 | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | 11610 4310 21010 15810 Good Job

EASIEST CONVERSIONS Binary to Octal and Octal to Binary Each Base 8 digit has no more than 3 bits in the binary version. Binary to Octal Starting from the right, take groups of three bits, convert to base 8. 11010000101111002 001 101 000 010 111 100 1 5 0 2 7 4 = 1502748 Octal to Binary Write three bits for each Base 8 digit 173608 1 7 3 6 0 001 111 011 110 000 = 11110111100002

EASIEST CONVERSIONS 11010000101111002 1101 0000 1011 1100 D 0 B C Binary to Hexadecimal and to Hexadecimal to Binary Each Base 16 digit has no more than 4 bits in the binary version. Binary to to Hexadecimal Starting from the right, take groups of four bits, convert to base 16. 11010000101111002 1101 0000 1011 1100 D 0 B C = D0BC16 Hexadecimal to Binary Write three bits for each Base 16 digit 3A4F16 3 A 4 F 0011 1010 0100 1111 = 111010010011112

ONCE BASE 2 CAN BE REACHED FROM THE OTHER BASES IT IS EASY TO GET FROM ANY BASE TO ANY OTHER BASE. 9810 = 11000102 = 001 100 010 = 0110 0010 = 1 4 2 = 6 2 = 1428 = 6216 You try these. DEC BIN OCT HEX 236 _________ _____ _____ 11101100 354 EC ____ __________ 251 _____ 169 10101001 A9 111 1101111 157 ____ __________ _____ 6F

ADDING AND SUBTRACTING IN OTHER BASES ADD SUBTRACT BASE 16 2A4 D96 +97F -9AE 93E 93E +6DA -6DA REMEMBER TO THINK AND SPEAK WITH BASE 10 NUMBERS (WE HAVE THE IDEA 10 ) BUT SEE AND WRITE BASE 16 NUMERALS (WE SEE AND WRITE A ) C23 3E8 1018 264

ADDING AND SUBTRACTING IN OTHER BASES ADD SUBTRACT BASE 8 137 516 +461 -437 505 500 +245 -245 REMEMBER TO THINK AND SPEAK WITH BASE 10 NUMBERS (WE HAVE THE IDEA 8 ) BUT SEE AND WRITE BASE 8 NUMERALS (WE SEE AND WRITE 10 ) 620 57 752 233

ADDING AND SUBTRACTING IN OTHER BASES ADD SUBTRACT BASE 2 REMEMBER TO THINK AND SPEAK WITH BASE 10 NUMBERS (WE HAVE THE IDEA 8 ) BUT SEE AND WRITE BASE 2 NUMERALS (WE SEE AND WRITE 1000 ) 1010 11010 +1110 -1101 11000 1101 To simplify the ALU (arithmetic logic unit) in the CPU, the only operation the computer performs is addition. How? By using one’s and two’s complement.---

ONE'S COMPLIMENT AND TWO'S COMPLEMENT First, let’s look at base 10 ten’s and nine’s complement Instead use the ten’s compliment which is the next higher power of 10. 1000 -283 Ten’s complement - > 717 Add the 10’s compliment to the top number and throw away the 562 carry. +717 1279 Subtract: 562 -283 279 Easier way: Add 9’s complement + 1 999 So 562 This can be -283 +717 done easily Nine’s complement-> 716 1279 in your head. . +1 Same as above 717

Now for the one’s and two’s complement Subtract: 1001 - 101 100 Instead use the two’s compliment which is the next higher power of 2. 10000 -101 Two’s complement - > 1011 Add the 2’s compliment to the top number and throw away the 1001 carry. +1011 10100 Easier way: Add 1’s complement + 1 1111 So 1001 This can be -0101 +1011 done easily One’s complement-> 1010 10100 in your head. +1 Same as above 1011 In the CPU the inverter or NOT Circuit performs the 1’s complement. Easiest method of all coming up next.------------------------------->

EASIEST WAY TO GET THE TWO'S COMPLEMENT Subtract the long way. 10010111 -01101010 Rules for the easiest method 1. Copy the subtrahend exactly as it until and including the first one (1) 00101101 10 The easy method 10010111 + 2. After the first one, invert (or NOT) all bits to the one’s complement. 10010110 100101101 1 1 1 10 3. Now we have the ten’s complement. Add this to the top number. 4. Discard the carry.

Note: Negative numbers in the computer are stored in For Practice Write the two’s complement of these numbers. 1. 100011000 011101000 Good Job! 11000100 2. 00111100 010101011 3. 101010101 Note: Negative numbers in the computer are stored in two’s complement form. Also: In positive binary numbers the last bit to the left is 0. In negative binary numbers the last bit to the left is 1.

THE END