• 沒有找到結果。

楊伏夷

N/A
N/A
Protected

Academic year: 2022

Share "楊伏夷"

Copied!
37
0
0

加載中.... (立即查看全文)

全文

(1)

數位系統 Digital Systems

Department of Computer Science and Information Engineering, Chaoyang University of Technology

朝陽科技大學資工系

Speaker: Fuw-Yi Yang

楊伏夷

伏夷非征番,

道德經 察政章(Chapter 58)

者潛藏也

道紀章(Chapter 14) 道無形象, 視之不可見者曰

(2)

Text Book: Digital Design 4th Ed.

Chap 1 Digital Systems and Binary Numbers

1.1 Digital Systems

1.2 Binary Numbers-- Table 1.1

1.3 Number-Base Conversions-- Example 1.1~1.4 1.4 Octal and Hexadecimal Numbers -- Table 1.2 1.5 Complements -- Example 1.5~1.8

1.6 Signed Binary Numbers -- Table 1.3 1.7 Binary Codes -- Table 1.4~1.7

1.8 Binary Storage and Registers -- Figure 1.1~1.2 1.9 Binary Logic -- Table 1.8, Figure 1.3~1.6

(3)

Text Book: Digital Design 4th Ed.

Chap 1 1.2 Binary Numbers

In general, a number expressed in a base-r system has coefficients multiplied by powers of r:

an⋅rn+an-1⋅rn-1+…+a1⋅r1+a0+a-1⋅r-1+a-2⋅r-2 +…+a-m⋅r-m r is called base or radix.

(4)

In general, a number expressed in a base-r system has coefficients multiplied by powers of r:

an⋅rn+an-1⋅rn-1+…+a1⋅r1+a0+a-1⋅r-1+a-2⋅r-2 +…+a-m⋅r-m r is called base or radix.

(5)

Text Book: Digital Design 4th Ed.

Chap 1 1.2 Binary Numbers

是否注意到指數為負之值呢?

Ex: 2-1, 2-3 ,2-4

(6)

Text Book: Digital Design 4th Ed.

Chap 1 1.3 Number-Base Conversions

Example1.1 Convert decimal 41 to binary, (41)10 = (?)2 (41)D= (?)B Example1.2 (153)10 = (?)8

Example1.3 (0.6875)10 = (?)2 Example1.4 (0.513)10 = (?)8

(7)

Text Book: Digital Design 4th Ed.

Chap 1 1.4 Octal and Hexadecimal Numbers

See Table 1.2

(8)

Text Book: Digital Design 4th Ed.

Chap 1 1.4 Octal and Hexadecimal Numbers

See Table 1.2

(9)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements

Diminished Radix Complement

Given a number N in base r having n digits, the (r - 1)’s complement of N is defined as (rn - 1) - N.

The 1’s complement of 1011000 is 0100111 Radix Complement

Given a number N in base r having n digits, the r’s complement of N is defined as

rn - N for N

0 and as 0 for N = 0 . The 2’s complement of 1011000 is 0101000

(10)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

The subtraction of two n-digit unsigned numbers M - N in base r can be done as follows:

1. M + (rn - N ), note that (rn - N ) is r’s complement of N.

2. If M ≥ N, the sum will produce an end carry rn, which can be discarded; what is left is the result M - N.

3. If M < N, the sum does not produce an end carry and is equal to rn - (N - M), which is r’s complement of

(N - M). Take the r’s complement of the sum and place a negative sign in front.

(11)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.5 Using 10’s complement, subtract 72532 - 3250.

1. M = 72532, N = 3250, 10’s complement of N = 96750 2.

3. answer: 69282

sum addend augend

....

169282 96750 72532

←←

+ ←

(12)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.6 Using 10’s complement, subtract 3250 - 72532.

1. M = 3250, N = 72532, 10’s complement of N = 27468 2.

3. answer: -(100000 - 30718) = -69282

30718

27468

03250

+

(13)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.7 Using 2’s complement,

subtract 1010100 - 1000011.

1. M = 1010100,

N = 1000011, 2’s complement of N = 0111101 2.

3. answer: 0010001

10010001

0111101

1010100

+

(14)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.7' Using 2’s complement,

subtract 1000011 - 1010100.

1. M = 1000011,

N = 1010100, 2’s complement of N = 0101100 2.

3. answer: - (10000000 - 1101111) = -0010001

1101111

0101100

1000011

+

(15)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.8 Using 1’s complement,

subtract 1010100 - 1000011.

1. M = 1010100,

N = 1000011, 1’s complement of N = 0111100 2.

3. answer: 0010001 (rn carry, call end-around carry)

10010000

0111100

1010100

+

(16)

Text Book: Digital Design 4th Ed.

Chap 1 1.5 Complements— Subtraction with Complements

Example 1.8' Using 1’s complement,

subtract 1000011 - 1010100.

1. M = 1000011,

N = 1010100, 1’s complement of N = 0101011 2.

3. answer: - (1111111 - 1101110) = -0010001

1101110

0101011

1000011

+

(17)

Text Book: Digital Design 4th Ed.

Chap 1 1.6 Signed Binary Numbers

Next table shows signed binary numbers

(18)

Text Book: Digital Design 4th Ed.

Chap 1 1.6 Signed Binary Numbers

Arithmetic addition Arithmetic subtraction See next table

(19)

Text Book: Digital Design 4th Ed.

Chap 1 1.6 Signed Binary Numbers

Arithmetic addition with comparison:

The addition of two numbers in the signed magnitude system follows the rules of ordinary arithmetic.

If the signed are the same, we add the two magnitudes and give the sum the common sign.

If the signed are different, we subtract the smaller magnitude from the larger and give the difference the sign of the larger magnitude. EX. (+25) + (-38) = -(38 - 25) = -13

(20)

Text Book: Digital Design 4th Ed.

Chap 1 1.6 Signed Binary Numbers

Arithmetic addition without comparison:

The addition of two signed binary numbers with negative numbers represented in signed 2’s complement form is obtained from the addition of the two numbers, including their signed bits. A carry out of the signed bit position is discarded (note that the 4th case).

See examples in next page.

(21)

Text Book: Digital Design 4th Ed.

Chap 1 1.6 Signed Binary Numbers

Arithmetic addition without comparison:

11101101 11110011 11111010 19

13 06 11111001

11110011 00000110 07

13 06

00000111 00001101 11111010 07

13 06 00010011

00001101 00000110 19

13 06

+ + +

− − +

+ +

− + −

+ + + +

− + +

+ + +

+ +

(22)

Text Book: Digital Design 4th Ed.

Chap 1 1.7 Binary Codes

BCD (Binary-Coded Decimal) Code Table 1.4 Decimal codes Table 1.5

(4 different Codes for the Decimal Digits) Gray code Table 1.6

ASCII character code Table 1.7 Error Detecting code

See next tables 1.4~1.7

(23)

Text Book: Digital Design 4th Ed.

Chap 1 1.7 Binary Codes

BCD Code

Decimal codes Gray code

ASCII character code Error Detecting code See next tables

(24)

Text Book: Digital Design 4th Ed.

Chap 1 1.7 Binary Codes

BCD Code

Decimal codes Gray code

ASCII character code Error Detecting code See next tables

(25)

Text Book: Digital Design 4th Ed.

Chap 1 1.7 Binary Codes

BCD Code

Decimal codes Gray code

ASCII character code Error Detecting code See next tables

(26)

Text Book: Digital Design 4th Ed.

Chap 1 1.7 Binary Codes

BCD Code

Decimal codes Gray code

ASCII character code Error Detecting code See next tables

(27)

Text Book: Digital Design 4th Ed.

Chap 1 1.8 Binary Storage and Registers

A register is a group of binary cells.

A register with n cells can store any discrete quantity of information that contains n bits.

A digital system is characterized by its registers and the components that perform data processing.

In digital systems, a register transfer operation is a basic operation that consists of a transfer of binary information from one set of registers into another set of registers.

(28)

Text Book: Digital Design 4th Ed.

Chap 1 1.8 Binary Storage and Registers

A register is a group of binary cells.

A register with n cells can store any discrete quantity of information that contains n bits.

A digital system is characterized by its registers and the components that perform data processing.

In digital systems, a register transfer operation is a basic operation that consists of a transfer of binary information from one set of registers into another set of registers.

(29)

Text Book: Digital Design 4th Ed.

Chap 1 1.8 Binary Storage and Registers

A register is a group of binary cells.

A register with n cells can store any discrete quantity of information that contains n bits.

A digital system is characterized by its registers and the components that perform data processing.

In digital systems, a register transfer operation is a basic operation that consists of a transfer of binary information from one set of registers into another set of registers.

(30)

Text Book: Digital Design 4th Ed.

Chap 1 1.9 Binary Logic

Binary logic consists of binary variables and a set of logical operations.

There are three basic logical operations:

AND, OR, and NOT.

AND, OR, NOT: Table 1.8 Binary signals: Figure 1.3

Logic circuit: Figures 1.4~1.6 Ex 1.35, 1.36

(31)

Binary logic consists of binary variables and a set of logical operations.

There are three basic logical operations:

AND, OR, and NOT.

See truth table 1.8 next page.

(32)
(33)
(34)
(35)
(36)
(37)

參考文獻

相關文件

bgez Branch on greater than or equal to zero bltzal Branch on less than zero and link. bgezal Branch on greter than or equal to zero

• The memory storage unit holds instructions and data for a running program.. • A bus is a group of wires that transfer data from one part to another (data,

Given a connected graph G together with a coloring f from the edge set of G to a set of colors, where adjacent edges may be colored the same, a u-v path P in G is said to be a

z gases made of light molecules diffuse through pores in membranes faster than heavy molecules. Differences

A Boolean function described by an algebraic expression consists of binary variables, the constant 0 and 1, and the logic operation symbols.. For a given value of the binary

Q.10 Does your GRSC have any concerns or difficulties in performing the function of assisting the SMC/IMC to review school‐based policies and

files Controller Controller Parser Parser.

The continuity of learning that is produced by the second type of transfer, transfer of principles, is dependent upon mastery of the structure of the subject matter …in order for a