1/25
Created from P.M.T and Ada Comp. Sci. notes
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What number base is binary?
Base 2
What number base is denary?
Base 10
What number base is hexadecimal?
Base 16
Why is hexadecimal often shown to humans insted of binary?
It is easier to read and interpret…
… and uses less characters…
… so is less likely to be written or read incorrectly
Most significant bit (MSB) of a binary number
Bit that is furthest to the left
Least significant bit (LSB) of a binary number
Bit that is furthest to the right
Bit
A single binary digit
Byte
8 bits
Nybble
4 bits; half a byte
Two methods of representing negative numbers in binary
Sign and magnitude
Two’s complement
How does sign and magnitude represent numbers?
MSB is a sign bit - 0 means positive, 1 means negative. This is equivelent to adding a + or - in front of the number
The rest of the bits show the magnitude (size) of the number
Example: 01100 →+(8+4)→ 12, and 11100→ -(8+4)→ -12
How does sign and magnitude represent numbers?
Makes the MSB negative (e.g. in 8 bit number MSB is usually 128, bit in ___ it is -128)
Rest of the bits are normal
Example, 01100→(8+4)→12, 10100→(-16+4)→ -12
How do you turn a positive number to its negative equivelent in two’s complement?
Flip all the bits and add one
Example: 24=011000, flip bits→100111, add one→101000=-24
How to turn a negative number to its positive equivelent in two’s complement
Subtract one and flip all the bits
Flip all the bits and add one
Example: -19=101101, subtract one→101100, flip bits→010011=19
Advantage of two’s complement over sign and magnitude
Makes binary arithmetic with negative numbers much more simple
Disadvantage of sign and magnitude
Makes binary arithmetic with negative numbers more complicated
As such it is rarely used in modern systems
You have a fixed number of bits to store a real binary number. Describe the trade-off between accuracy and range when deciding how many bits to use for the mantissa and exponent.
The larger the mantissa the more accurate the number
The larger the exponent the greater the range of numbers that can be stored
What does the start of a normalised floating point number start with
01 for positive numbers
10 for negative numbers
What us a character set?
The characters a computer uses / understands
How is a character set used to represent text in a computer?
Each character is assigned a unique character code
Each letter is converted to its character code (which is a binary number)
What would happen if computers were to use different character sets when communicating?
Characters from a computer using one characterset will be interpreted as different characters by a computer using another character set.
As such text will be incomprehensible.
Explain how computers are able to represent text.
Computers use a character set to map binary values to characters
Each character is represented by a unique value called a bit pattern
Similarities between ASCII and UNICODE
Both are character sets
The first 8 bits of UNICODE are the same as ASCII
Disadvantages of ASCII
Has a very limited number of characters so is not suitable for multilingual text
Advantages of UNICODE over ASCII
Can represent more characters
Can represent foreign alphabets
Can represent emojis and symbols
Disadvantages of UNICODE
Can take up more storage space