SD & D Representing Positive Numbers
-
Upload
forrester-high-school -
Category
Education
-
view
410 -
download
0
Transcript of SD & D Representing Positive Numbers
![Page 1: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/1.jpg)
![Page 2: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/2.jpg)
Decimal NumbersIn 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 thousands104
thousands103
hundreds102
tens101
units100
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
![Page 3: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/3.jpg)
The Binary Number SystemThe 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
![Page 4: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/4.jpg)
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
![Page 5: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/5.jpg)
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.
![Page 6: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/6.jpg)
Why design computers as 2 state devices?
4. Magnetic and optical media are suited to two state systems.
![Page 7: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/7.jpg)
Binary NumbersWe have seen that the number 42678 can be represented as:
104 103 102 101 100
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:
24 23 22 21 20
1 1 0 1 1
Or
16 8 4 2 11 1 0 1 1
![Page 8: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/8.jpg)
Converting Binary Numbers to Decimal
The binary number 1 1 0 0 1
16 8 4 2 11 1 0 0 1
= (1 * 16) + (1 * 8) + (0 * 4) + (0 * 2) + (1 * 1)
= 16 + 8 + 0 + 0 + 1
= 25
![Page 9: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/9.jpg)
Converting a Byte to DecimalThe term bit is short for binary digit
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 11 0 1 0 1 1 0 1
= (1 * 128) + (1 * 32) + (1 * 8) + (1 * 4) + (1 * 1)
= 128 + 32 + 8 + 4 + 1
= 173
3264128
![Page 10: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/10.jpg)
Converting Decimal Numbers to BinaryExample: Convert 86 to binary
1280
Next 64. Does 64 go into 86? Yes.128 640 1
Subtract the 64 from 86, leaving 22. Next 32. Does 32 go into the remaining 22? No
128 64 320 1 0
Start with 128. Does 128 go into 86? No.
![Page 11: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/11.jpg)
128 64 32 160 1 0 1
Next 16. Does 16 go into 22? Yes.
Converting Decimal Numbers to Binary
Subtract the 16 from 22, leaving 6. Next 8. Does 8 go into the remaining 6? No
128 64 32 16 80 1 0 1 0
Next 4. Does 4 go into the remaining 6? YesSubtract 4 from 6, leaving 2.Next 2. Does 2 go into the remaining 2? YesSubtract 2 from 2, leaving 0.Finally 1. Does 1 go into the remaining 0? No128 64 32 16 8 4 2 10 1 0 1 0 1 1 0
![Page 12: SD & D Representing Positive Numbers](https://reader036.fdocuments.net/reader036/viewer/2022081605/58745c971a28abd53e8ba379/html5/thumbnails/12.jpg)
CreditsHigher Computing – Data Representation – Representation of Positive Numbers
Produced by P. Greene and adapted by R. G. Simpson for the City of Edinburgh Council 2004
Adapted by M. Cunningham 2010
All images licenced under Creative Commons 3.0•Hard Disk B by Christian Jansky•CD-ROM by Vincent1969•Voltometer by Brandi Sims•Numbers by Procsilas Moscas