1.4.1 Data Types
No description yet. This curated deck is ready for daily study.
Card preview (12)
What is a logical shift?
• 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
Masks
Can be applied to binary numbers by combining them with logic gates
Bits and bytes
• 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
Character set
• 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.
ASCII (American Standard Code for information interchange)
• 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
ASCII benefits
Uses a lot less storage space than Unicode
ASCII drawbacks
• 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
Unicode
• 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
Unicode benefits
• it can represent more characters than ascii • it can represent special character such as emojis • it can represent multilingual text
Unicode drawbacks
It uses a lot more storage space than ASCII
Trade off between accuracy and range
• larger mantissa increases accuracy [1] • smaller exponent decreases range [1]
Explain how codes are used to represent a Character set
• each symbol has a unique binary code [1] • e.g ascii uses 7 bits per character