Binary Numbers Flashcards
In our normal number system we have ten different digits. What are they known as?
- denary
- decimal
- base-10
Binary uses 2 different digits. What is this called?
base-2
How do you count in binary?
- similar to denary
- place values from right to left increase by powers of 2 instead of powers of 10 like denary
What can 8 bit numbers represent?
The denary numbers 0-255
What can 16 bit numbers represent?
The denary numbers 0-65535
What can 32 bit numbers represent?
The denary numbers 0-4294967295
In binary how do we add?
- 0 + 0 = 0
- 1 + 0 = 1
- 0 + 1 = 1
- 1 + 1 = 10
What is overflow?
When during binary arithmetics you will get a result that requires more bits than the CPU is expecting.
e.g. 11111111 + 00000001 = 100000000
The 1 is seen as a overflow error and the computer will output 00000000 which is nonsense.
How do computers deal with overflow?
Store the extra bits elsewhere.
What are used to show that an overflow error has occurred?
Overflow flags
What is an issue with overflow?
- loss of data and accuracy
- cause software to crash if doesn’t have a way of dealing with the extra bit.
What is a binary shift (also known as logical shift)?
Moves every bit in a binary number left or right a certain number of places.
What are gaps filled in with in a binary shift?
Gaps at beginning or end are filled in with 0s
What does a left binary shift do?
- multiplies
- every place shifted left the number is doubled
What does a right binary shift do?
- divides
- every place shifted right the number is halved