Title: Computer Coding
1Computer Coding Number Systems
?.????????? ?????????????????????????? ?????
3503500 ??? 715E-mail pattamaporn.p_at_bu.ac.thHom
epage http//tulip.bu.ac.th/pattamaporn.p/
2??????????????????????????????
- ?????????????????????????????????????????????????
?????????????????? ?????????????????????????
Binary System -
3Binary System
??????????????????????????? Bit (Binary Digit)
?????????????????????????????????????????
???????????????????????????????????
4 Bit
?????????????(??? 2) ??????????????? ?????????
one bit
two bits
three bits
5Binary System
?????????????? (??????? 256 ??????)?????Binary
System ??????????????????????????? 0 ??? 1
?????????????????????????????????????????????
(???? ???? ???) ???????????????????????????
6Off/On Switches
- ?????????????????????????????????????????????????
????????????????????????????????? (on) ???????
(off)
or
off
on
7Zero or One?
- ?????????????????? (off) ????????? Bit 0
???????? ??????????????? (on) ????????? Bit 1
or
Off (0)
On (1)
81 0 1 1 0 0 1 0
1 0 0 1 0 0 1 0
1 0 0 1 0 0 1 1
1 1 1 1 1 1 1 1
9Byte
- 8 Bits 1 Byte (1 ??????)
- ???? 0100 0001 A
- 0100 0010 B
10One Character of Data
- ??? 1 Byte ?????????????? ?????? 1 ???
??????????? - ???????? (A, B, , a, b, )
- ?????? (0, 1, 2, ) ????
- ?????????????? (!, , _at_, , )
11Examples from the ASCII Text Code
12?????????? (Coding Schemes)
- Extended Binary Coded Decimal Interchange Code
(EBCDIC???-??-???) ??????????????? 256
??????????????????????????????? - American Standard Codes for Information
Interchange (ASCII) - ?????????????????? PC - Unicode ???? 16 bit ??? 1 Byte ???????????????
65536
13Storing Bytes
- ??????????????????? Storage ??????????? Memory
??????????? Bytes
1 Kilobyte 210 or 1024 bytes 1 Megabyte 220
or 1,048,576 bytes 1 Gigabyte 230 or
1,073,741,824 bytes
14?? (Computer Word)
- ?????????????????????????????????????????????????
?????????????????????????????????????????????
(Word Length) ???????????
15?????????? (Number Bases)
16Number Bases 10,2,8,16
17????????????????? 2 ???? ??? 10
- ????????????????
- Ex. 10112 ??????????????????????? 10
- (1x23) (0x22) (1x21) (1x20)
- 8 0 2 1
- 11
18????????????????? 2 ???? ??? 10
- ?????????
- 11112
- 101012
- 1011102
19????????????????? 10 ???? ??? 2
- ????????????????????
- Ex. 12 ??????????????????????? 2
20????????????????? 10 ???? ??? 2
- 2 ) 12
- 2 ) 6 ???????? 0
- 2 ) 3 ???????? 0
- 2 ) 1 ???????? 1
- 0 ???????? 1
???????????????? 11002
21????????????????? 10 ???? ??? 2