Sidan ‹#›
Computer Engineering InstrDataFormat page 1
Data representation
■ How do we represent data in a digital system? ■ Digital data is stored as bits: – a bit is a binary number {0, 1} – in a hardware design this is usually interpreted as
■ 0 Volt, GND ■ {5, 3.3, 1.8, … } Volt, VCC
Computer Engineering InstrDataFormat page 2
String of bits!
Everything we work with is represented as a string of bits. Example:
– We don't work with integers! – We represent (encode) integers as strings of bits and manipulate those.
1 0 1 0 (binary) represents 1*23 + 0*22 + 1*21 + 0*20 (decimal) 8 + 0 + 2 + 0 = 10 (decimal)
Computer Engineering InstrDataFormat page 3
Ask yourself:
■ How many bits are required to represent this thing? ■ How can we do it? – We need to structure the information.
Computer Engineering InstrDataFormat page 4
Word, halfword and byte
■ “The word: 32 bits”. ■ “The halfword: 16 bits”. ■ “The byte: 8 bits”.
31 15 7 Low order bit High order bit
Computer Engineering InstrDataFormat page 5
“The Space”
■ We can group a large number of bit strings into an
array called a space.
■ We use at least three spaces: – the register space. – the instruction space. – the data space. ■ Do not confuse them!
Computer Engineering InstrDataFormat page 6
The Register Space
(or Register “file”)
■ An array of words. ■ Smallest addressable unit is the word. ■ 32 choices, how do we select? – 2x = 32, x? – x=5 – i.e., we need 5 bits!
1 2 3 29 30 31