Upcoming SlideShare
×

# Representation of Positive Numbers

2,063 views
1,918 views

Published on

Higher Computing – Data Representation – Representation of Positive Numbers

1 Comment
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Good slide .....you make it simple to understand more easy......

Are you sure you want to  Yes  No
• Be the first to like this

Views
Total views
2,063
On SlideShare
0
From Embeds
0
Number of Embeds
822
Actions
Shares
0
21
1
Likes
0
Embeds 0
No embeds

No notes for slide

### Representation of Positive Numbers

1. 2. Decimal Numbers In every day life we use 10 decimal numbers to represent numerical data 0 1 2 3 4 5 6 7 8 9 The number 42678 can be read as ten thousands 10 4 thousands 10 3 hundreds 10 2 tens 10 1 units 10 0 4 2 6 7 8 The number that forms the basis of any system is called the base . So the decimal number system is called base 10 .
2. 3. The Binary Number System The lowest number base that can be used to represent numbers is base 2 . Using only two numbers to represent what happens inside a computer is called the binary system . on = 1 bit off = 0 bit
3. 4. Why design computers as 2 state devices? 1. Simplicity in only having to generate and detect two voltage levels. 2. Good tolerance, because a degraded positive voltage (1 bit) is still recognisable as a positive voltage
4. 5. Why design computers as 2 state devices? 3. Calculations are kept simple. There are four rules for addition / subtraction / multiplication / division in the binary number system. There are one hundred rules for addition / subtraction / multiplication / division in the decimal number system.
5. 6. Why design computers as 2 state devices? 4. Magnetic and optical media are suited to two state systems.
6. 7. Binary Numbers We have seen that the number 42678 can be represented as: 10 4 10 3 10 2 10 1 10 0 4 2 6 7 8 Binary (base 2) works in a similar way. The binary number 1 1 0 0 1 can be represented as: 2 4 2 3 2 2 2 1 2 0 1 1 0 1 1 Or 16 8 4 2 1 1 1 0 1 1
7. 8. Converting Binary Numbers to Decimal The binary number 1 1 0 1 1 16 8 4 2 1 1 1 0 1 1 = ( 1 * 16) + ( 1 * 8) + ( 0 * 4) + ( 0 * 2) + ( 1 * 1) = 16 + 8 + 0 + 0 + 1 = 25
8. 9. Converting a Byte to Decimal The term bit is short for b inary dig it A byte is made up of 8 bits The byte 1 0 1 0 1 1 0 1 can be converted to decimal as: 16 8 4 2 1 1 0 1 0 1 1 0 1 = ( 1 * 128) + ( 1 * 32) + ( 1 * 8) + ( 1 * 4) + ( 1 * 1) = 128 + 32 + 8 + 4 + 1 = 173 32 64 128
9. 10. Converting Decimal Numbers to Binary Example: Convert 86 to binary 128 0 Next 64 . Does 64 go into 86? Yes. 128 64 0 1 Subtract the 64 from 86, leaving 22. Next 32 . Does 32 go into the remaining 22? No 128 64 32 0 1 0 Start with 128 . Does 128 go into 86? No.
10. 11. Converting Decimal Numbers to Binary 128 64 32 16 0 1 0 1 Next 16 . Does 16 go into 22? Yes. Subtract the 16 from 22, leaving 6. Next 8 . Does 8 go into the remaining 6? No 128 64 32 16 8 0 1 0 1 0 Next 4 . Does 4 go into the remaining 6? Yes Subtract 4 from 6, leaving 2. Next 2 . Does 2 go into the remaining 2? Yes Subtract 2 from 2, leaving 0. Finally 1 . Does 1 go into the remaining 0? No 128 64 32 16 8 4 2 1 0 1 0 1 0 1 1 0
11. 12. Credits <ul><li>Higher Computing – Data Representation – Representation of Positive Numbers </li></ul><ul><li>Produced by P. Greene and adapted by R. G. Simpson for the City of Edinburgh Council 2004 </li></ul><ul><li>Adapted by M. Cunningham 2010 </li></ul><ul><li>All images licenced under Creative Commons 3.0 </li></ul><ul><li>Hard Disk B by Christian Jansky </li></ul><ul><li>CD-ROM by Vincent1969 </li></ul><ul><li>Voltometer by Brandi Sims </li></ul><ul><li>Numbers by Procsilas Moscas </li></ul>