Data 1 Flashcards
Why is binary used for computers?
Because computers are made of digital switches (transistors) that can either be on or off. We use binary digits (bits) to represent these transistors’ states.
What is the general formula for the relationship between number of bits and number of binary patterns?
number of binary patterns = 2 ^ number of bits
What are all the multiples of bytes in ascending order?
bit (b)
nibble (N)
byte (B)
kibibyte (KiB)
mebibyte (MiB)
gibibyte (GiB)
tebibyte (TiB)
pebibyte (PiB)
Burger
King
Made
Great
Toast
Previously
(but now?)
How many bits in a nibble?
4
How many bits in a byte?
8
How many bytes in a kibibyte?
1024
What is an unsigned number in binary?
a positive number
What is
overflow?
an error that occurs when the number of bits reserved for the result of a calculation are not enough to store all the bits from the number
What is a signed number in binary?
a negative number
What is
two’s complement?
a way of representing negative numbers in binary where the most significant bit is negative
How can you turn a binary number negative?
- flip the bits
- add 1
What are
binary shifts?
shifts which are used to move all the bits in a binary pattern left or right
What are
logical shifts?
shifts which treat all the bits of a binary pattern in the same way, irrespective of what the pattern represents
What is bad about
logical shifts?
an imprecise result may be produced
What are the benefits of
arithmetic shifts?
they give us the ability to divide negative numbers by 2^n
(because the value in the MSB is preserved)