1.4.1 Data Types Flashcards
1
Q
What is a logical shift?
A
- a shift performed on a binary numbers
- logical shift left : multiplication
- logical shift right : division
- n= number of places shifted, has the effect of multiplying or dividing by 2^n
2
Q
Masks
A
Can be applied to binary numbers by combining them with logic gates
3
Q
Bits and bytes
A
- a bit is a binary digit (can be 1 or 0)
-which is the fundamental unit of information - 1 and 0 are used to represent 2 electrical states on and off
- 8 bits = 1 byte
- 4 bits = 1 nibble
4
Q
Character set
A
- A published collection of codes paired with corresponding characters.
- Enables computers to represent text using binary code.
- Two main character sets are Unicode and ASCII.
5
Q
ASCII (American Standard Code for information interchange)
A
- a character set used to map binary values to characters [1]
- uses 7 bits to encode each character [1]
- can represent 128 distinct characters
- is used to represent characters in the English language
6
Q
ASCII benefits
A
Uses a lot less storage space than Unicode
7
Q
ASCII drawbacks
A
- it has a limited number of characters/ is limited to 128 characters
- it can’t represent multilingual characters/text
- it does not include special characters like emojis
8
Q
Unicode
A
- a character set which is used to map binary values to characters [1]
- uses up to 32 bits to encode each character [1]
- it supports a very large number of characters [1]
- used to represent characters across the world
9
Q
Unicode benefits
A
- it can represent more characters than ascii
- it can represent special character such as emojis
- it can represent multilingual text
10
Q
Unicode drawbacks
A
It uses a lot more storage space than ASCII
11
Q
Trade off between accuracy and range
A
- larger mantissa increases accuracy [1]
- smaller exponent decreases range [1]
12
Q
Explain how codes are used to represent a Character set
A
- each symbol has a unique binary code [1]
- e.g ascii uses 7 bits per character