Chapter 1-DigitalSystemsInformation
Chapter 1-DigitalSystemsInformation
1
Contents
1. Information Representation
2. Abstraction Layers in Computer System Design
3. Number Systems
4. Arithmetic Operations
5. Decimal Codes
6. Alphanumeric Codes
7. Gray Codes
2
1. Information Representation
3
Signal Examples Over Time
Time
Continuous in value
Analog & time
4
Signal Example
• The two discrete values are defined by ranges of voltages called LOW and HIGH
• Binary values are represented abstractly by:
• Digits 0 and 1, words (symbols) False (F) and True (T), words (symbols) Low (L) and High (H), and words On
and Off (positive logic)
5
2. Abstraction Layers in Computer System
Design
6
2. Abstraction Layers in Computer System
Design
• Algorithms describe a series of steps that lead to a solution.
• These algorithms are then implemented as a program in a high level
Algorithms programming language such as C++, Python, or Java.
Programming Languages • When the program is running, it shares computing resources with other programs
Operating Systems under the control of an operating system.
• Both the operating system and the program are composed of sequences of
Instruction Set Architecture instructions that are particular to the processor running them; the set of
Microarchitecture instructions and the registers.
• The processor hardware is a particular implementation of the instruction set
Register Transfers architecture, referred to as the microarchitecture; manufacturers very often make
Logic Gates several different microarchitectures that execute the same instruction set.
• A microarchitecture can be described as underlying sequences of transfers of data
Transistor Circuits between registers.
Typical Layers of Abstraction in Modern • These register transfers can be decomposed into logic operations on sets of bits
Computer Systems performed by logic gates.
• An important feature of abstraction is that • Logic gates are electronic circuits implemented with transistors or other physical
lower layers of abstraction can usually be devices that control the flow of electrons.
modified without changing the layers
above them.
7
3. Number Systems
9
Binary Numbers
10
Special Powers of 2
11
Octal and Hexadecimal Numbers
13
Octal and Hexadecimal Numbers
14
Binary Hexadecimal
0000 0
Octal and Hexadecimal Numbers
0001 1
0010 2
0011 3
0100 4
0101 5
• Conversion from binary to hexadecimal is easily
0110 6 accomplished by partitioning the binary number
0111 7 into groups of four bits each, starting from the
1000 8 binary point and proceeding to the left and to the
1001 9 right. The corresponding hexadecimal digit is then
1010 A
assigned to each group.
1011 B
1100 C
(0010 1100 0110 1011.1111 0000 0110)2 = (2C6B.F06)16
1101 D
1111 F
15
Octal and Hexadecimal Numbers
16
Decimal Binary Octal Hexadecimal
00 00000 00 00
02 00010 02 02
03 00011 03 03
04 00100 04 04
05 00101 05 05
06 00110 06 06
07 00111 07 07
08 01000 10 08
09 01001 11 09
10 01010 12 0A
11 01011 13 0B
12 01100 14 0C
13 01101 15 0D
14 01110 16 0E
15 01111 17 0F
16 10000 20 10 17
Number Ranges
• In digital computers, the range of numbers that can be represented is based on the number
of bits available in the hardware structures that store and process information.
• The number of bits in these structures is most frequently a power of two, such as 8, 16, 32,
and 64.
• 8-bit unsigned integers: 0 –> 28-1 (0 -> 255)
• 16-bit unsigned integers: 0 –> 216-1 (0 -> 65535)
• 32-bit unsigned integers: 0 –> 232-1 (0 -> 4,294,967,295)
• 64-bit unsigned integers: 0 –> 264-1 (0 -> 18,446,744,073,709,551,615)
• Since the numbers of bits is fixed by the structures, the addition of leading or trailing zeros to
represent numbers is necessary, and the range of numbers that can be represented is also
fixed.
18
4. Arithmetic Operations
19
4. Arithmetic Operations
20
4. Arithmetic Operations
• Binary multiplication
• The multiplier digits are always 1 or 0. Therefore, the partial
products are equal either to the multiplicand or to 0.
Multiplicand 1011
x
Multiplier 101
1011
0000
1011
Product 110111
21
Hexadecimal Addition
22
Octal Multiplication
23
Conversion from Decimal to Other Bases
25
Conversion from Decimal to Other Bases
26
Conversion from Decimal to Other Bases
27
Conversion from Decimal to Other Bases
• The answer, to three significant figures, is obtained from the integer digits. Note
that the last integer digit, 5, is used for rounding in base 8 of the second-to-the-
last digit, 6, to obtain
(0.513)10 = (0.407)8
28
Conversion from Decimal to Other Bases
29
5. Decimal Codes
• Information Types
• Numeric
• Must represent range of data needed
• Very desirable to represent data such that simple, straightforward
computation for common arithmetic operations permitted
• Tight relation to binary numbers
• Non-numeric
• Greater flexibility since arithmetic operations not applied.
• Not tied to binary numbers
30
5. Decimal Codes
32
5. Decimal Codes
33
6. Alphanumeric Codes
34
35
36
ASCII Character Code
• ASCII is a 7-bit code, but most computers manipulate an 8-bit quantity as a single
unit called a byte. Therefore, ASCII characters most often are stored one per byte,
with the most significant bit set to 0.
• The extra bit is sometimes used for specific purposes, depending on the application.
• For example, some printers recognize an additional 128 8-bit characters, with the most
significant bit set to 1. These characters enable the printer to produce additional symbols, such
as those from the Greek alphabet or characters with accent marks as used in languages other
than English.
• ASCII was developed for the English alphabet but, even extending it to 8-bits, it is
unable to support other alphabets and scripts that are commonly used around the
world.
37
Unicode
39
Unicode
40
UTF-8
• The first 128 code points are encoded with a single byte, which
provides compatibility between ASCII and UTF-8.
• Thus a file or character string that contains only ASCII characters will be the
same in both ASCII and UTF-8.
• In UTF-8, the number of bytes in a multi-byte sequence is indicated
by the number of leading ones in the first byte. Valid encodings must
use the least number of bytes necessary for a given code point.
41
UTF-8
42
Parity Bit
43
7. Gray Codes
44
7. Gray Codes
45