DSA Studio
Search
Home
Sign in
Bit I/O & Universal Codes Checkpoint
MSB-first semantics, padding, and Elias codes.
1. MSB-first means:
First bit goes to the highest bit of the byte
First bit goes to the lowest bit of the byte
Bits are reversed per byte
Bits are written LSB-first
2. WriteBits(value, n) writes:
The lowest n bits of value, MSB-first
The highest n bits of value, LSB-first
All 64 bits of value
Bits in random order
3. Gamma code for n=1 is:
1
01
001
0
4. Gamma code length grows roughly as:
2*floor(log2 n) + 1
floor(log2 n)
n
1
5. Delta coding first encodes:
The bit-length of n using gamma
The value n using gamma
The length of zeros
A fixed-width integer
6. Trailing padding bits should be:
Zeros
Ones
Alternating
Random
7. Gamma code for n=13 (1101) is:
0001101
001101
01101
0001011
8. True/False: Bit order must be consistent across writer and reader.
Submit quiz
Auto-advance on pass