Title: ??????????????? (computer system)
1??????????????????????????
2??????????????? (computer system)
- PEOPLEWARE
- HARDWARE
- SOFTWARE
3PEOPLEWARE
- User
- Data Entry Operator
- Computer Operator
- Programmer (Application Programmer, System
Programmer) - System Analyst
- Administrator (System, Network, Database)
- EDP Manager
4HARDWARE
CPU
Control Unit
Arithmetic/logic Unit
Memory
Input device
Output device
5CPU (Central Processing Unit)
- ????????????????? ?????????? ??????????????????
(arithmetic and logic unit) ??????????????????????
????????????????????? ?????????????? (control
unit) ??????????????????????? ?
??????????????????????????????????????????????????
?? ??? ?????????? (registers) ????????????????????
?? ? ??????????? 2 ?????? ??? - ????????????????????? (general purpose registers)
?????????????????????????????????????????????????
??????????????????????????? - ?????????????????? (special purpose registers)
????????????????????????????????????? ???? PC
(Program Counter) ????????????????????????????????
???????????????????, IR (Instruction Register)
????????????????????????????????, MAR (Memory
Address Register) ????????????????????????????????
????????????????????????????????, PSW (Program
Status Word Register) ????????????? ?
???????????????? ???????
6INPUT DEVICE
- ???????? keyboard, mouse, disk drive, tape drive,
microphone, joystick
7OUTPUT DEVICE
- ???????? ?????, printer, disk drive, tape drive,
plotter, speaker
8MEMORY
address
bit binary digit byte 8 bits 1K 210
bytes 1M 220 bytes 1G 230 bytes
0
1
2
???????? s ????? bit ??????????? address ???? s
3 ???? address 0-7 ???????
2s -1
RAM (Random Access Memory) ROM (Read-Only
Memory)
9SOFTWARE
- System Software
- - System Management Programs
- Operating Systems
- - System Development Programs
- Compiler, Interpreter, Editor
- - System Support Programs
- utility, performance monitor, security
monitor - Application Software
- - General-purpose Programs
- e.g. word processing, spreadsheet
- - Application-Specific Programs
- e.g. airline reservation, banking
10COMPUTER LANGUAGE
- Low-level Language
- - Machine language
- - Assembly Language
- High-level Language
- e.g. C, Pascal, FORTRAN
11ASSEMBLER
assembly language
source program
assembler
machine language
object program
COMPILE TIME
12COMPILER
high-level language
source program
compiler
machine language
object program
COMPILE TIME
13RUN TIME
machine language
input data
output
14INTERPRETER
source program
output
interpreter
input data
COMPILE and RUN TIME
15??????????????????? C
- include ltstdio.hgt
- main()
-
- int i,j
- scanf(d,i)
- j2i5/10-3
- printf(d d\n,i,j)
16??????????????????? assembly
- .386
- .data
- i dd ?
- j dd ?
- .code
- mov i,10
- mov ax,i
- add ax,5
- mov j,ax
- end
17MACHINE LANGUAGE
18DATA REPRESENTATION
- CHARACTER
- INTEGER
- FLOATING POINT
- Binary Code Decimal (BCD)
19CHARACTER
- ASCII (8 bits) ??????????? 7 ?????????????????????
?? 1 ??????? parity ??? - EBCDIC (8 bits)
- UNICODE (16 bits)
20(No Transcript)
21INTEGER
- UNSIGNED INTEGER
- SIGNED INTEGER
22UNSIGNED INTEGER
- ?????????????? n ??? ????????????????????????????
???????? ??????? 0 ??? 2n-1 ???? n 16
??????????????????????????? 0 ??? 65535 ???????
23n 1
24n 2
- binary decimal
- 00 0
- 01 1
- 10 2
- 11 3
25n 3
- binary decimal
- 000 0
- 001 1
- 010 2
- 011 3
- 100 4
- 101 5
- 110 6
- 111 7
26SIGNED INTEGER
- SIGNED MAGNITUDE
- ONE COMPLEMENT
- TWO COMPLEMENT
27SIGNED MAGNITUDE
- ??????????????????????????? ?????? 0 ??? ??? ???
1 ????? ?????????????????????????????? - ???? ???????????? ???????? 8 ??? ??????????? 5
??? 5 ??????? 00000101 ??? 10000101 ??????? - ??????????? n ??? ???????????????????????????????
?? ?????????? - (2n-1 1) ??? (2n-1- 1)
28n 2
- binary decimal
- 00 0
- 01 1
- 10 -0
- 11 -1
29n 3
- binary decimal
- 000 0
- 001 1
- 010 2
- 011 3
- 100 -0
- 101 -1
- 110 -2
- 111 -3
30ONE COMPLEMENT
- ????????????? ?????????????? ?????? 0 ??? ???
??? 1 ??? - ?? ???????????? ?????????????? sign magnitude
????????????????? ????????? - ??? one complement ??????????????????? ??
complement (????????????? 0 ???? 1 ???
????????????? 1 ???? 0) ??? magnitude ????
???????????? ???????? 8 ??? ??????????? 5 ??? 5
??????? 00000101 ??? 11111010 ??????? - ??????????? n ??? ??????????????????????????????
??? ?????????? (2n-1 1) ??? (2n-1- 1)
31n 2
- binary decimal
- 00 0
- 01 1
- 10 -1
- 11 -0
32n 3
- binary decimal
- 000 0
- 001 1
- 010 2
- 011 3
- 100 -3
- 101 -2
- 110 -1
- 111 -0
33TWO COMPLEMENT
- ??????????????????????????? ?????? 0 ??? ???
??? 1 ??? - ?? ???????????? ?????????????? sign magnitude
????????????????? ????????? - ??? two complement ??????????????????? ??
complement (????????????? 0 ???? 1 ???
????????????? 1 ???? 0) ??? magnitude
???????????????? ???? ???????????? ???????? 8 ???
??????????? 5 ??? 5 ??????? 00000101 ???
11111011 ??????? - ??????????? n ??? ??????????????????????????????
??? ?????????? (2n-1) ??? (2n-1- 1)
34n 2
- binary decimal
- 00 0
- 01 1
- 10 -2
- 11 -1
35n 3
- binary decimal
- 000 0
- 001 1
- 010 2
- 011 3
- 100 -4
- 101 -3
- 110 -2
- 111 -1
36FLOATING POINT
- ???????????????????????????? ???? 1.234x1085
???????????????? 1.234x10 85 ???
???????????????? ???? mantissa ???? fractional
part ??? ???? exponent ????????? ??????????
(base exponent) ??? 10 ???? 1.234X1035 ?? 1.234
???????? mantissa ??? 35 ???????? exponent
???????????? 10 - ??????????????????????? mantissa ??? exponent
?????????????????????????????????
??????????????????????????????????????????????????
??? ?????????????????????????????????????????????
????????? ??????????????? ???? 2, 4, 8, ???? 16
?????????????????????? 10 ????????????????????????
???? ????????????????????????? mantissa ???
normalized ??? ????????????????
???????????????????? mantissa (????????? 0
?????????????????? ???? mantissa ??? exponent
???? 0 ???????)
37????????
- (0.00173)10 ???????????????? 0.000173x101 ,
0.001730x100, 0.017300x10-1, ???? 0.173000x10-2
??????????????????? normalized - (103.5)10 ??????? normalized ??? 0.1035x103
-
38IEEE standard
39IEEE standard
40IEEE standard
41?????????
- biased exponent mantissa special meaning
- all 0 all 0 floating point zero
- all 0 nonzero denormalized
- all 1 all 0 infinity
- all 1 nonzero NaN (Not a Number)
42????????
- decimal 10.0 ???????? binary ??? IEEE standard,
short real ?????? - 0100 0001 0010 0000 0000 0000 0000 0000
43Binary Code Decimal (BCD)
44BCD
- ??? binary 4 ??? ??? decimal ???????? ??????
-
- BCD decimal
- 0000 0
- 0001 1
- 0010 2
- 0011 3
- 0100 4
- 0101 5
- 0110 6
- 0111 7
- 1000 8
- 1001 9
45Unpacked BCD
- ???????????????????????????? 0000
???????????????????? BCD ???????? ???? decimal
1234 ?????? Unpacked BCD ?????? 0000 0001 0000
0010 0000 0011 0000 0100
46Packed BCD
- ???????????????????????????? BCD ????????
???????????????????? BCD ??????????? ???? decimal
1234 ?????? Packed BCD ?????? 0001 0010 0011
0100 ????????????????? ??????????????????? ????
decimal 234 ?????? Packed BCD ?????? 0000 0010
0011 0100
47???? data representation
data
character
integer
floating point
BCD
ASCII
unsigned
packed
unpacked
signed
EBCDIC
signed magnitude
UNICODE
one complement
two complement
48INSTRUCTION
- ???????????????????????
- CPU ???????????????????????????????????????
(machine language) ???????? ??????????????????????
?????????????? ????????????????????????????? ???
????????????? (operation code) ?????????? ???
??????????????? (operands) ??????????????
????????????????????
49INSTRUCTION
- ????????????? ???? ???, ??, ???, ???? ???
??????? ???????????? ???????? ???????????????????
???????????????????????????? ?????????????????????
????????????? ???????? immediate operand ????
???????????? ? ?????????????????????????????
???????? register operand ???? ???????????????????
????????????????????????????????????
50INSTRUCTION
- ???????
- ??????????????? ?????????????????????????????????
???????????? ???? - ??????????? ?????????????
- 011 100 101 ADD A,B
51INSTRUCTION
- CPU ???????????????????????? ?????????????
??????????????????????? ? ??????? ??????????? ?
???? ????????????????????? X (AB)(C/D)-10
??????????????????????????????????????????????????
???? ??????????????????????????????????
?????????? ??? - T1AB
- T2C/D
- T3T1T2
- XT3-10
52INSTRUCTION
- ???????????????????????????????????
?????????????????????? ???? ??????????????????????
??????????????, ???????????????????????????????
???????????????????????????????? ??????? ????
?????????????????????????????? ??????
53INSTRUCTION
- ???????????????????????
- ?????????????????????????????? 3 ??? ????
- ?????? ????????
- ADD X,Y,T TXY
- SUB X,Y,T TX-Y
- MUL X,Y,T TXY
- DIV X,Y,T TX/Y
54????????
- X (AB)(C/D)-10 ??????????????????????????????
????? ?????? - MUL A,B,T1
- DIV C,D,T2
- ADD T1,T2,T3
- SUB T3,10,X
55INSTRUCTION
- ????????????????????
- ?????????????????????????????? 2 ??? ????
- ?????? ????????
- ADD X,Y XXY
- SUB X,Y XX-Y
- MUL X,Y XXY
- DIV X,Y XX/Y
- MOV X,Y XY
- CMP X,Y ??????????? X ??? Y ???????????
- FLAG ????
EQ, GT, ???? LT
56INSTRUCTION
- ?????????????????????????
- ?????????????????????????????? 1 ??? ????
- JEQ X ?????????????????? X ??? FLAG ???? EQ
- JLT X ?????????????????? X ??? FLAG ???? LT
- JGT X ?????????????????? X ??? FLAG ???? GT
- JMP X ?????????????????? X ????????????????
- ????????????????????
- ?????????????????????????????????
57????????
- X (AB)(C/D)-10 ??????????????????????????????
????? ?????? - MUL A,B
- DIV C,D
- ADD A,C
- SUB A,10
- MOV X,A
58????????
- if (A B) then AA1
- else BB-1
- ????????????????????????????? ??????
- CMP A,B
- JEQ L1
- SUB B,1
- JMP L3
- L1 ADD A,1
- L3
59????????
- SUM0
- FOR I1 TO 100 DO
- SUMSUMI
- ??????????????????????? ??????
- MOV SUM,0
- MOV I,1
- L1 CMP I,100
- JGT L2
- ADD SUM,I
- ADD I,1
- JMP L1
- L2
60?????????????????????? CPU
fetch ??????????? memory ??? address
?????????????? Program Counter ??? Program
Counter ???????????????????? ???????? Program
Counter ???? address ??????????????
execute ????????????? ?????? decode ????
operation code ???????????????????