Uploaded by Uduakobong Udombat

1.1.1 Binary

advertisement
“Knowledge is power” …Bacon
What is information? What do we do with it? How do
we use it?
1.1.1 Binary
Objectives
recognise the use of binary numbers in computer systems
convert positive denary integers into binary and positive binary integers into
denary (a maximum of 16 bits will be used)
show understanding of the concept of a byte and how the byte is used to
measure memory size
use binary in computer registers for a given application (such as in robotics,
digital instruments and counting systems)
How do computers work?
Computers are electrical devices.
What do we know about
electricity?
What is Binary?
Lets play a game!!!!
Click here to play a game based on the
binary number system.
Click here to play ...
What is binary?
Binary is a system that only uses two digits to store information: 1 and 0. All
information that is processed by a computer is in the form of a sequence of 1s and
0s. Therefore, all data that we want a computer to process needs to be converted
into binary.
How to convert from Binary to Denary
1. Label each column with its
place value
2. For each column with a 1
add that column value to
the total
How to convert from denary to binary
1. Write out the binary
column values
2. Find the highest power of
2 less than the current
denary value
3. Put a 1 in that column
and take that value from
your denary value
4. Repeat steps 2-3 until
you get to 0
Binary Practice - Convert the following to denary/ 8
bit binary
1.
2.
3.
4.
5.
0101 0101
0000 1111
0100 1111
1111 1111
1000 0001
A.
B.
C.
D.
E.
129
49
72
201
28
Bits, Bytes and Measuring Memory
We use 2 to power 10
or 1024 as it is binary
and close to 10 to the
power 3 which is 1000
and a standard.
How is data storage measured?
A single 1 or 0
1 bit
4 bits
1 nibble
8 bits
1 byte
2^10 or 1024 bytes
1 kibibyte
2^10 or 1024 kibibytes
1 mebibyte
2^10 or 1024 mebibytes
1 gibibyte
2^10 or 1024 gibibytes
1 tebibyte
2^10 or 1024 tebibytes
1 pebibyte
2^10 or 1024 pebibytes
1 exbibyte
How binary registers can be used
A register is a small temporary storage location
A robot is controlled using an 8 bit ( 1 byte ) register.
Design a system for the control of the robot.
1.1.2 Binary Arithmetic
Learning Objectives
4 (a) Add two positive 8-bit binary integers
(b) Understand the concept of overflow and why it occurs in binary addition
5 Perform a logical binary shift on a positive 8-bit binary integer and understand
the effect this has on the positive binary integer
6 Use two’s complement to represent positive and negative 8-bit binary integers
Binary Addition of 8 bit Binary numbers
We will watch the video here to introduce Binary addition.
What is OVERFLOW and why does it occur in BINARY ADDITION
Binary Left Shifting
What does shifting a binary number left by one position do to its value?
A left shift, by adding zeros to the right side, multiplies the value by two each time
but be careful an OVERFLOW ERROR can occur if you go too far
Binary Right Shifting
What does shifting a binary number right by one position do to its value?
A right shift, by adding zeros to the left side, divides the value by two each time
but be careful an UNDERFLOW ERROR can occur if you go too far
Using Two's Complement to represent positive and
negative integers
Download