You are on page 1of 47

KỸ THUẬT SỐ

HỆ THỐNG SỐ - MÃ SỐ

Nguyễn Duy Thảo


ngduythao76@gmail.com
Images taken from:
R. J. Tocci et ..., Digital Systems: Principles and Applications, Prentice Hall.
Thomas L. Floyd, Digital Fundamental, Prentice Hall.
Đại học Sư phạm Kỹ thuật Tp.HCM – Khoa Điện Điện tử
1. Số thập phân

MSD (Most significant Digit).


LSD (Least significant Digit).
1. Số thập phân
2. Số nhị phân

MSB (Most significant Bit).


LSB (Least significant Bit).
2. Số nhị phân
2. Số nhị phân
• Phương pháp theo trọng số.

• Ví dụ:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phương pháp nhân 2:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phương pháp trọng số:

• Ví dụ:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phương pháp chia 2:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Ví dụ:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phương pháp nhân 2.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phép cộng.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
2. Số nhị phân
• Phép trừ.

• Ví dụ.
2. Số nhị phân
• Phép nhân.

• Ví dụ
2. Số nhị phân
• Phép chia số nhị phân.

• Ví dụ.
2. Số nhị phân
• Số nhị phân bù 1.

• Mạch bù 1.
2. Số nhị phân
• Số nhị phân bù 2.

• Mạch bù 2.
2. Số nhị phân
• Số nhị phân có dấu dạng: dấu – độ lớn.

• In the sign-magnitude form, a negative number has the


same magnitude bits as the corresponding positive number
but the sign bit is a 1 rather than a zero.
2. Số nhị phân
• Số nhị phân có dấu dạng: bù 1.

• In the 1’s complement form, a negative number is the 1’s


complement of the corresponding positive number.
• Số nhị phân có dấu dạng: bù 2.

• In the 2’s complement form, a negative number is the 2’s


complement of the corresponding positive number.
2. Số nhị phân
• Số nhị phân có dấu dạng bù 1, 2.
2. Số nhị phân
• Giá trị thập phân của số nhị phân có dấu.
2. Số nhị phân
• Giá trị thập phân của số nhị phân có dấu.
2. Số nhị phân
• Giá trị thập phân của số nhị phân có dấu.
2. Số nhị phân
• Phép cộng số nhị phân có dấu.
2. Số nhị phân
• Phép trừ số nhị phân có dấu.
2. Số nhị phân
• Phép nhân số nhị phân có dấu.
2. Số nhị phân
• Phép chia số nhị phân có dấu.
3. Số thập lục phân
• Số thập lục phân
– 16 possible symbols: 0-9 and A-F

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân
• Chuyển thập lục phân sang thập phân.

• Ví dụ.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân
• Chuyển thập phân sang thập lục phân:

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân
• Chuyển thập lục phân sang nhị phân.

• Chuyển nhị phân sang thập lục phân.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân
• Phép cộng.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
3. Số thập lục phân
• Phép trừ.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Binary Coded Decimal (BCD) is a widely used
way to present decimal numbers in binary form.
• BCD is not a number system.
• A BCD number is not the same as a straight binary
number.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Chuyển số 87410 to BCD:

• Ví dụ.

• So sánh giữa BCD và Binary.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Chuyển 0110100000111001 (BCD) sang Decimal.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Phép cộng.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Phép cộng.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
4. Mã BCD
• Phép cộng.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
5. Mã Gray
• Mã Gray 3 bit .

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
5. Mã Gray
• Mã Gray 4 bit .

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
5. Mã Gray
• Chuyển Gray sang Binary và ngược lại.

Binary to Gray Gray to Binary


Copyright ©2007 by Pearson Education, Inc.
Columbus, OH 43235
All rights reserved.
5. Mã Gray
• Chuyển Gray sang Binary và ngược lại.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
6. Mã Alphanumeric
• Represents characters and functions found on
a computer keyboard.
– 26 lowercase & 26 uppercase letters, 10 digits,
7 punctuation marks, 20 to 40 other characters.
• ASCII – American Standard Code for Information
Interchange.
– Seven bit code: 27 = 128 possible code groups
– Examples of use: transfer information between
computers; computers & printers; internal storage.

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
6. Mã Alphanumeric

Copyright ©2007 by Pearson Education, Inc.


Columbus, OH 43235
All rights reserved.
7. Mã thừa 3
• Mã thừa 3 bằng Binary cộng 3.
Thâ ̣p phân Mã thừa 3
0 0011
1 0100
2 0101
3 0110
4 0111
5 1000
6 1001
7 1010
8 1011
9 1100 Copyright ©2007 by Pearson Education, Inc.
Columbus, OH 43235
All rights reserved.

You might also like