4. Data representation and data types Flashcards
What is a character set?
A defined list of characters recognized by the computer’s hardware and software, with each character being represented by a number. They are agreed standards for referring to all the characters a computer can use.
What is ASCII?
A 7-bit character set that has space for 128 symbols, enough for standard English. The codes are stored by computers as 8 bits with the MSB set to 0.
What is extended ASCII?
An 8-bit character set that provides extra characters for foreign languages and graphic symbols.
What is Unicode?
A 24-bit character set that has characters from every written language, historic symbols and emojis. Hexadecimal is often used instead of binary as writing 24 bits is slow and cumbersome.
How many bits are needed to store a single character?
8 bits (ASCII)
16 bits (Unicode)
How many bits are needed to store a string?
8 bits per character (ASCII)
16 bits per character (Unicode)
How many bits are needed to store an unsigned/signed integer?
16 bits (short integer)
64 bits (long integer)
How many bits are needed to store a boolean?
1 bit
What are the advantages of using standardized character sets?
- ensures all computers use the same character representation
- Unicode allows storage of complex characters such as Chinese symbols
- Unicode can represent a larger range of characters than ASCII