Data Encoding + Representations Flashcards
What is a bit?
Bit represents the state of a transistor, where each piece of information (0 or 1) is a bit
What is a byte?
A byte is made up of 8 bits
Where 256 values can be stored in a byte
Advantage of using hexadecimal over binary
A: Easier to read
R: 4 binary digits can be represented by 1 hexadecimal digit, thus long binary numbers can be represented with shorter strings which increases readability
What is ASCII encoding?
ASCII encoding encodes 128 different symbols (usually the more common symbols such as digits/lower and upper case characters)
ASCII uses 7 bits to represent each symbol.
What is unicode encoding?
Unicode can encode characters from
1. almost all langauges
2. math symbols
3. Emojis
…
Examples: UTF-8 is backward compatible with ASCII, thus any ascii string is also UTF-8 string
Advantage of using Unicode over ASCII
Feature: Able to encode more characters of different language
A: Webpages using unicode can display more languages, allowing for more flexible designs etc
Feature: UTF-8 is backward compatible with ASCII
A: minimal code changes when switching from ASCII to UTF-8
Advantage of using ASCII over unicode
Feature: ASCII only takes up 7bits to represent one character, which is way less than unicode
A: More efficient use of memory for simpler tasks (provided that context; does not require multi language/complex characters to be display)
How to write answer if asked to represent decimal as binary/hex?
(77)₁₀ = (01001101)₂ = (4D)₁₆
What is character encoding?
Character encoding refers to the set of values that define how information is stored in an electronic format