You are on page 1of 19

Data Representation in Digital Systems

José Navarro-Figueroa
Data Representation in Digital Systems
Objectives
• Explain why binary numeric system is used when working with
digital systems
• Explain what is a bit
• List several ways bits are grouped
• List values that are important to remember when working with
binary values
• List different data that is commonly represented using digital
systems

José Navarro 2020


Models and Basic Principles for Data Representation
• Two Voltage levels:
– High: V> Vhmin ➔ Symbol 1
– Low: V < Vlmax ➔ Symbol 0
• Power Supplies:
– VCC: is also usually maximum value for High
– VSS (may be ground): is also usually minimum value for low
• We represent actions using relationships between “1”’s and
“0”’s

José Navarro 2020


Bits, Bytes, and Words

José Navarro 2020


Computer as a Binary Digital System
• Digital System
– Finite number of symbols
• Binary (base two) system:
– Has two states (for example: 0 and 1)

José Navarro 2020


Computer as a Binary Digital System …
Bit
– Binary Digit
– Basic unit of information
– Values with more than two states requires multiple bits
• A collection of n bits has 2𝑛 posible states
• A collection of two bits has four posible states:
– 00, 01, 10, 11
• A collection of three bits has eight posible states:
– 000, 001, 010, 011, 100, 101, 110, 111

José Navarro 2020


What kinds of data do we need to represent?
• Numbers – signed, unsigned, integers, floating point,
complex, rational, irrational, …
• Text – characters, strings, …
• Images – pixels, colors, shapes, …
• Sound
• Logical – true, false
• Instructions
• …

José Navarro 2020


Basic Definitions
• Bit: 1 or 0
– A bit variable can only have a value 1 or a value 0
• n-bit word: an ordered sequence of n bits
– Examples: 00101, 1100, 11011100
– General Representation: bn-1 bn-2 … b1 b0
• Most significant bit (msb or MSb): Leftmost bit, bn-1
• Least significant bit (lsb or LSb): Rightmost bit b0

José Navarro 2020


Basic Definitions …
• Specific word names:
– Nibble: 4-bit word
– Byte: 8-bit word
– Word: 16-bit word
– Double word (long): 32-bit word
– Quad: 64-bit word

• The terms least significant byte (LSB), most significant byte


(MSB), least significant nibble (LSN), etc. are used similar to
previous definition
• Notice ambiguity in use of “word”. Must be specific when
necessary.
José Navarro 2020
Notation for words
• To describe the contents of a register or word, we use
– Binary numbers, one digit per value: 11011001
– Its equivalent decimal integer: 217
– Its hex equivalent: D9
– Its octal equivalent (less used): 331
• Suffices are used if necessary: 11011001b, 217, 217D, 0xD9 or D9h or
0D9h, 331q
• This notation does not refer to the meaning of data. Only to physical
contents.

José Navarro 2020


Representing with words
• We can only use 0’s and 1’s to represent all sort of data
• Meaning of an n-bit word is context dependent
– The word may be interpreted as a whole, bit by bit or by groups of
bits.
• When necessary, we use more than one n-bit word

José Navarro 2020


Representing with words

• Basic principle • Special cases


With n-bit words we can • Nibbles: 2^4 = 16 cases
represent at most 2n • Bytes: 2^8 = 256 cases
different elements. • Words: 2^16 = 65,536
• Double word: 2^32 = 4,294,967,296
• Quad: 2^64 = 18,446,744,073,708,271,616

José Navarro 2020


Powers of two and definitions
N 2^N N 2^N N 2^N
0 1 11 2048 21 2097152
1 2 12 4096 22 4194304
2 4 13 8192 23 8388608
3 8 14 16384 24 16777216
4 16 15 32768 25 33554432
5 32 16 65536 26 67108864
6 64 17 131072 27 134217728
7 128 18 262144 28 268435456
8 256 19 524288 29 536870912
9 512 20 1048576 30 1073741824
10 1024 21 2097152 31 2147483648
José Navarro 2020
Powers of two and definitions
• 1 Kilo (1K) = 2^10 = 1 024
– Example: 16K = (2^4)(2^10)=2^14
• 1 Mega (1M) = 2^20 = 1 048 576
– Example: 4M = (2^2)(2^20) = 2^22
• 1 Giga (1G) = 2^30 = 1 073 741 824
– Example: 8G = (2^3)(2^30)=2^33
• 1 Tera (1T) = 2^40 = 1 099 511 627 776
• NOTE: When speaking of hard drives, the powers are of ten
(1K=10^3, 1M=10^6, etc.)

José Navarro 2020


Binary Systems to Represent More than Numbers
• Numbers
• Characters
• Images
• Sound
• Sensors states
• Anything that needs to be represented in a computer

José Navarro 2020


ASCII Code
• Maps 128 characters (printable and not printable) to 7-bit code

José Navarro 2020


Extended ASCII Code

José Navarro 2020


Interesting Properties of ASCII Code
• What is relationship between a decimal digit ('0', '1', …)
and its ASCII code?

• What is the difference between an upper-case letter


('A', 'B', …) and its lower-case equivalent ('a', 'b', …)?

• Given two ASCII characters, how do we tell which comes first in


alphabetical order?

• Are 128 characters enough?


(http://www.unicode.org/)
José Navarro 2020
Sistemas Numéricos

José Navarro 2020

You might also like