• 沒有找到結果。

# 楊伏夷

N/A
N/A
Protected

Share "楊伏夷"

Copied!
37
0
0

(1)

數位系統 Digital Systems

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

Speaker: Fuw-Yi Yang

## 夷

(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

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.

## + ←

(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

## +

(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.

## +

(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

## +

(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)

## +

(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

## +

(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

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

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

## + +

(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)

Outcome of a Dentigerous Cyst following Decompression using a Removable Appliance: A Case Report OHDM-vol.13-No.1-March 2014. Basak Durmus, Barhan Pekel, Faysal Ugurlu,

 Miloro and Quinn advocate dividing multifocal central giant cell lesions into synchronous or metachronous lesions: metachronous lesions are more likely to represent a

Positron emission tomography: a new, precise imaging modality for detection of primary head and neck tumors and assessment of cervical adenopathy..

// The Screen class is a collection of methods, each implementing one // abstract screen-oriented operation. Most of this code

// The Screen class is a collection of methods, each implementing one // abstract screen-oriented operation. Most of this code

– The Parity flag is set when an instruction generates an even number of 1 bits in the low byte of the destination operand.. – The Auxiliary Carry flag is set when an

• 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,

• The memory storage unit is where instructions and data are held while a computer program is running.. • A bus is a group of parallel wires that transfer data from one part of

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

• Definition: A binary tree is a finite set of nodes that is either empty or consists of a root and two disjoint binary trees called the left subtree and t he right subtree2.

The proof is suitable for R n if the statement is that every closed set in R n is the intersection of a countable collection of open sets.. All we need is to change intervals

• For a given set of probabilities, our goal is to construct a binary search tree whose expected search is smallest.. We call such a

Because communities of interest are often important, the basic theoretical concept in the bandwagon model is not the number of users, but the user set– that is, the set of consumers

One is to survey the state of the MOW service in Taiwan; another is to propose a feasible operation model of MOW service including of order-processing

In this paper, given a placement of connecting registers in a circuit inside a clock mesh and the setup and hold timing constrains of registers, a two-phase