?????????????????????? BCD, EBCDIC, ASCII - PowerPoint PPT Presentation

1 / 49
About This Presentation
Title:

?????????????????????? BCD, EBCDIC, ASCII

Description:

3 ( ... – PowerPoint PPT presentation

Number of Views:458
Avg rating:3.0/5.0
Slides: 50
Provided by: comp144
Category:
Tags: ascii | bcd | ebcdic

less

Transcript and Presenter's Notes

Title: ?????????????????????? BCD, EBCDIC, ASCII


1
????? 3 ??????? ???????????????????
  • ??????????????? (???? ??? 2 ??? 8 ??? ??? 16)
  • ?????????????
  • ????????????????????? 2 ??? 8 ?????? 16
  • ?????????????????????????????????
  • ?????????????????????? BCD, EBCDIC, ASCII
  • ??????????????????????????? ????????? ?????????

2
?????????? (??? 2,8,10,16)
  • Place Value ?????????????????????????????????
  • ???????????? ??? ?????????????????
    ?????????????????????????? ??? ?????
  • Least significant digit ????????????????????????
    ???
  • Most significant digit ?????????????????????????
    ?
  • ??????????????????????????????? ????????? 10

3
????????????????
  • ??? 2 ????? 0,1
  • ??? 8 ????? 0,1,2,3,4,5,6,7
  • ??? 10 ????? 0,1,2,3,4,5,6,7,8,9
  • ??? 16 ????? 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

4
?????????????
  • ???????????????? ???? ??? 10
  • ????????????? 10 ???? ??????
  • ????????????? 2 ???? ??? 8 ??? 16
  • ????????????? 8 ??? 16 ???? ??? 2

5
??????????????????????? 10
  • ????????????????? ??????????????????
    ?????????????????????
  • ?.?. 11012 ( )10
  • ???????????? ???
  • 23 22 21 20
  • (18)(14)(02)(11) 13

6
????????????? 10 ??????????
  • ???? ????????????
  • ??????? MODULO ???
  • ?????? 10 ??????????? ???????????????????????????
  • ???????????????????
  • ???????????????????????????????????
  • ????????????????????????? ????????????????? Most
    significant

7
????????????????????? 10 ??????????
  • ????????????

1310 ( )2
1310 ( ) 4
4 13 3 1
13
2
2 6 1
2 3 0
1 1
??? 11012
??? 314
8
????????????? 10 ??????????
  • ???? ???????????? ??????????????? 2 ????
  • ???????????????????????? MODULO
  • ????????????????????
  • ??????????????????????????? ?????????????????????
  • ???????????????????????? ?????????????????????????
    ?????????

9
????????????????????? 10 ??????????
  • ????????????

13.4 10 ( )2
.4 2 0 .8 .8 2 1 .6 .6 2 1
.2 .2 2 0 .4
13
2
2 6 1
2 3 0
1 1
Ans 1101.01102
10
????????????? 2 ???? ??? 8 ??? 16
  • ????????????????????????
  • ?????? 2 ???? ??? 8 ?????????? 3 ???
  • ?????? 2 ???? ??? 16 ?????????? 4 ???
  • ??????????????????????????????????
    ????????????????????????? 0

11
????????????????????? 2 ??????? 8
  • ????????? 111112 ( 37 ) 8

0 1 1
1 1 1
(04)(12)(11)
(14)(12)(11)
3
7
12
????????????????????? 2 ??????? 16
  • ???????????? 0001.112 (1.C ) 16

1 1 0 0
0 0
0 0 0 1
(18)(14)(02)(01)
(08)(04)(02)(11)
12 C
1
13
????????????? 8 ??? 16 ???? ??? 2
  • ??????????????????????????????????? ???
  • ?????? 8 ????????? ???????????????? 2 ??? 3 ???
  • ?????? 16 ????????? ???????????????? 2 ??? 4 ???

14
????????????????????? 8 ??? 16 ???? ??? 2
  • ???? ????????????

738 ( ) 2
A316 ( ) 2
7 3
10 3
0 0 1 1
1 1 1 0 1 1
1 0 1 0
Ans 1010000116
Ans 1110112
15
????????????????????? 8 ??? 16 ???? ??? 2
  • ???? ????????????

7.38 ( ) 2
A3.B16 ( ) 2
7 . 3
10 3 . 11
1 1 1 0 1 1
1 0 1 0
0 0 1 1
1 0 1 1
Ans 10100001.101116
Ans 111 . 0112
16
??????????????
  • ????????????
  • ???????????
  • ??????????? ??? Complement

17
????????????
  • ??????

F31C16 235016 1266C16
1101.112 0111.012 10101.00 2

5345 1235
??????????? ????????????? 5 ????? 5
18
???????????
  • ????????

1011.0112 - 0111.1012 0011.1102
4325 - 1435 2345
19
???????????????? (Complement)
  • Complement ????????? (??? R ??????) ?? 2 ??????
    ??? Complement R ??? Complement R-1
  • ??? R-1 Comp. R
    Comp

2 1 Comp 2 Comp. 8
7 Comp 8 Comp 10
9 Comp 10 Comp
20
???????????????????
  • ???????????????? ??? R-1 ?????????
  • ???????????????????????????????????
  • ??????????? ??????????????????????????
  • ??? 2910 ??????????? ??? 99
  • 9 Comp 99 -29 70
  • ??? 101.112 ?????????????? 111.11
  • 1 Comp 111.11 - 101.11 010.00

21
???????????????????
  • ???????????????? ??? R ?????????
  • ??????????????????????????????????????????????
    ??????????? ???????????? ?????????????
    ???????????????????????
  • ??? 2910 ?? ??????????? ????
  • 10 Comp (99 1) - 29 71
  • ??? 101.112 ????????????????
  • 2 Comp (111.11 .01) - 101.11 0010.01

22
??????????????????????????????
  • ????? R-1 Complement ??? ?????????????????????????
    ?????????
  • 1 Complement ???????? 2 ??? ????????????????????
    ?????????????????
  • ??? R-1 Complement ????????????? R Complement
    ???? 1 ???? ? ?????????????
  • 2Comp 1 Comp 1 ????????????????

23
??????????????????????
  • ?????????????????????????
  • ????????????????????? ??? ?????????????
  • ?????????????????????????????
  • ???? R Comp. ??????????
  • ???? R-1 Comp. ??????????????????? ?????????????
  • ????????????????

24
??????????????????????????????
  • R-1 Comp.

1011.011 2- 111.1012 ? 1) 111.111 -
111.101 000.010 2) 1011.011
1000.010 1
0011.101 1
0011.110
4325 - 1435 ?
1) 444 - 143 301 2) 432 301
1 233 1 234
1
0
1
25
??????????????????????????????
  • ??????????? ??? R

1011.011 2- 111.1012 ? 1) 10000.000 -
0111.1011000.011 2) 1011.011
1000.011 1 0011.110

4325 - 1435 ?
1) 1000 - 143 302 2) 432 302
1 234
???????
26
?????????????????????????????? ???????????????
?????????????????
  • ????????????????????????????????? ???????????????
  • ????????????????????????????????????
  • ??????????????????????????????????????????????????
    ??????????????????????????????
  • ????????????????????????????????
    ?????????????????????????????????????????????

27
?????????????????????????????? ???????????????
?????????????????
???????? 10112-11002 ?
????????????? R-1 complement
28
?????????????????????????????? ???????????????
?????????????????
  • ????????????????????????????????? ???????????????
  • ????????????????????????????????????
  • ??????????????????????????????????????????????????
    ??????????????????????????????
  • ????????????????????????????????
    ?????????????????????????????????????????????

29
?????????????????????????????? ???????????????
?????????????????
???????? 10112-11002 ?
????? ?????????????????? R-1 ???? R complement
?
30
?????????????????????????????Data Representation
  • ????????????????????????????? (Alphanumeric Data
    Representation)
  • ??????????????????????????????? (Numeric Data
    Representation)
  • ???????????? (Integer Representation)
  • ????????????????? (Floating Point Representation)

31
?????????????????????????
  • ???? BCD Binary Coded Decimal Code
  • ???? EBCDIC Extended Binary Coded Decimal
    Interchange Code
  • ???? ASCII American Standard Code for
    Information Interchange

32
???? BCD
  • ??? 6 ???????????? 1 ???
  • ??????????????????? 64 ??? ( 26 ??????)

C B A 8 4 2 1
Digit bit
Zone bit
Check bit/ Parity bit
33
???? BCD
  • ?????????? BCD
  • ??????????????? (0 - 9) Zone Bit ?????? 00
  • ????????????????? ???? ?????????????? Zone bit
    ???? 11

34
???? EBCDIC
  • ??? 8 ???????????? 1 ???
  • ??????????????????? 256 ??? ( 28 ??????)

C B A 8 4 2 1
Digit bit
Zone bit
Check bit/ Parity bit
35
???? EBCDIC
  • ????????????????????? EBCDIC ?? 2 ???
  • ???????????? Zone Decimal
  • ???????????? Packed Decimal
  • ?????????????????? Zone bit ?????????
  • 1111 ?????????????????????????????????? ( 15
    ,F) 1100 ???????????????????????????? ???
    (,12 ,C) 1101 ???????????????????????????
    (-,13 ,D)

36
??????????????? Packed Decimal
  • ??????????????????????????????? EBCDIC
    ????????????????
  • ???????????????????????????????????????
  • ???????????????????????????????

37
??????? PACK
  • -123
  • ???????? Zone bit ??? Digit bit ?????????????
  • ??? Zone bit ??????? ????????
  • ????????????????? Digit Bit ??????
  • ????????????????? 16 (123D)16
  • ???? Unpack ???????????? ?????? Pack

1101 0001 1101 0010 1101 0011
38
???? ASCII
  • ?? 2 ???? ??? 7 ??? ??? 8 ??? ????????????????????
    ????????????????????????????????????????
  • ??????????? EBCDIC ?? Zone bit ????
  • ???????????? 0101 ??? 011
  • ?????????????? 1010 ??? 100

39
Parity bit ???? Check bit
  • ?????????????????????????????? ?? 2 ????
  • Even Parity ???????????? ????????????????????????
    ?? 1 ????????????????????????
  • Odd Parity ???????????? ??????????????????????????
    1 ????????????????????????

1 1 1 0 0 0 1
0 1 1 0 1 0 1
0 1 1 0 0 0 1

1 1 1 0 1 0 1
40
?????????????????????????????
  • ?????????????????? ???????????????????????????????
    ??????? (Fixed length word) ??????????????? 1
    ?????
  • half-word ??????????? 2 ????
  • Full-word ??????????? 4 ????
  • Double-word ??????????? 8 ????

41
??????????????????
  • Sign Magnitude / Pure binary code
  • 2 Complement
  • 1 Complement

42
Sign Magnitude
  • ??????????????????????????????????????? Sign bit
    ?????????????????????????? ???????? Magnitude

MSB
LSB
Sign bit
Magnitude
1 ??? ?? 0 ??? ???
1 Word 4 Byte 32 Bit
43
?????????????
  • ??? Sign Magnitude

1 Word 4 Byte 32 bit
31 32
2 1 0
25110012
0 1 1 0 0 1
.........................
0 0 0
-25
1 0 0 ......................... 0 1
1 0 0 1
44
?????????????
  • ??? 2 Complement
  • ??????????????????
  • ????????????????????????
  • ?????? ????????????? Sign Magnitude
  • ????? ?????????? 2 Complement ???????????????

45
???????? ????????? 2 Complement
  • ???? 28 111002

MSB
LSB
0
000000.............0000000000 1 1 1 0 0
1 111111.............1111111111 0 0 0 1 1

1
1 111111.............1111111111 0 0 1 0 0
46
Floating Point Representation
  • R - M B- E

31 30 24
0
Sign Exponent
Mantissa
S Sign ?????????????? ??? ?? ??????????? E
Exponent ?????????????? M Mantissa
?????????????????
47
???????????? Floating point
  • ??????????????????? 16
  • Normalization ?????? 16 (???????????? ???
    ???????)
  • ??????? Sign, Exponent, Mantissa ?????????? 2
  • Sign 1 ???????? 0 ?????????
  • Mantissa ?????????????? 2 ????????????? ??
    ?????????????????????

48
???????????? Floating point
  • Exponent ????????????????? ???? ?? ??????????????
    Excess 64
  • exponent 16 4016 true exponent16
  • exponent16 ----gt exponent 2

49
???????? ?? Floating point
  • 28 ----gt 1C16
  • 1C16 (.1C 102)16
  • Sign ----gt 0
  • Mantissa ----gt 0001 11002
  • Exponent ----gt 4016 216 42 16 -----gt 100 00102

0 100 0010 0001 11000000.......................
...
Write a Comment
User Comments (0)
About PowerShow.com