??????????????? (computer system) - PowerPoint PPT Presentation

1 / 60
About This Presentation
Title:

??????????????? (computer system)

Description:

Programmer (Application Programmer, System Programmer) ... CPU (Central ... printer, disk drive, tape drive, plotter, speaker. MEMORY. 0. 1. address ... – PowerPoint PPT presentation

Number of Views:19
Avg rating:3.0/5.0
Slides: 61
Provided by: scie342
Category:

less

Transcript and Presenter's Notes

Title: ??????????????? (computer system)


1
??????????????????????????
  • 3 ??????? 2547
  • 800-1200

2
??????????????? (computer system)
  • PEOPLEWARE
  • HARDWARE
  • SOFTWARE

3
PEOPLEWARE
  • User
  • Data Entry Operator
  • Computer Operator
  • Programmer (Application Programmer, System
    Programmer)
  • System Analyst
  • Administrator (System, Network, Database)
  • EDP Manager

4
HARDWARE
CPU
Control Unit
Arithmetic/logic Unit
Memory
Input device
Output device
5
CPU (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) ????????????? ?
    ???????????????? ???????

6
INPUT DEVICE
  • ???????? keyboard, mouse, disk drive, tape drive,
    microphone, joystick

7
OUTPUT DEVICE
  • ???????? ?????, printer, disk drive, tape drive,
    plotter, speaker

8
MEMORY
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)
9
SOFTWARE
  • 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

10
COMPUTER LANGUAGE
  • Low-level Language
  • - Machine language
  • - Assembly Language
  • High-level Language
  • e.g. C, Pascal, FORTRAN

11
ASSEMBLER
assembly language
source program
assembler
machine language
object program
COMPILE TIME
12
COMPILER
high-level language
source program
compiler
machine language
object program
COMPILE TIME
13
RUN TIME
machine language
input data
output
14
INTERPRETER
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

17
MACHINE LANGUAGE
  • DATA
  • INSTRUCTION

18
DATA REPRESENTATION
  • CHARACTER
  • INTEGER
  • FLOATING POINT
  • Binary Code Decimal (BCD)

19
CHARACTER
  • ASCII (8 bits) ??????????? 7 ?????????????????????
    ?? 1 ??????? parity ???
  • EBCDIC (8 bits)
  • UNICODE (16 bits)

20
(No Transcript)
21
INTEGER
  • UNSIGNED INTEGER
  • SIGNED INTEGER

22
UNSIGNED INTEGER
  • ?????????????? n ??? ????????????????????????????
    ???????? ??????? 0 ??? 2n-1 ???? n 16
    ??????????????????????????? 0 ??? 65535 ???????

23
n 1
  • binary decimal
  • 0 0
  • 1 1

24
n 2
  • binary decimal
  • 00 0
  • 01 1
  • 10 2
  • 11 3

25
n 3
  • binary decimal
  • 000 0
  • 001 1
  • 010 2
  • 011 3
  • 100 4
  • 101 5
  • 110 6
  • 111 7

26
SIGNED INTEGER
  • SIGNED MAGNITUDE
  • ONE COMPLEMENT
  • TWO COMPLEMENT

27
SIGNED MAGNITUDE
  • ??????????????????????????? ?????? 0 ??? ??? ???
    1 ????? ??????????????????????????????
  • ???? ???????????? ???????? 8 ??? ??????????? 5
    ??? 5 ??????? 00000101 ??? 10000101 ???????
  • ??????????? n ??? ???????????????????????????????
    ?? ??????????
  • (2n-1 1) ??? (2n-1- 1)

28
n 2
  • binary decimal
  • 00 0
  • 01 1
  • 10 -0
  • 11 -1

29
n 3
  • binary decimal
  • 000 0
  • 001 1
  • 010 2
  • 011 3
  • 100 -0
  • 101 -1
  • 110 -2
  • 111 -3

30
ONE 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)

31
n 2
  • binary decimal
  • 00 0
  • 01 1
  • 10 -1
  • 11 -0

32
n 3
  • binary decimal
  • 000 0
  • 001 1
  • 010 2
  • 011 3
  • 100 -3
  • 101 -2
  • 110 -1
  • 111 -0

33
TWO COMPLEMENT
  • ??????????????????????????? ?????? 0 ??? ???
    ??? 1 ???
  • ?? ???????????? ?????????????? sign magnitude
    ????????????????? ?????????
  • ??? two complement ??????????????????? ??
    complement (????????????? 0 ???? 1 ???
    ????????????? 1 ???? 0) ??? magnitude
    ???????????????? ???? ???????????? ???????? 8 ???
    ??????????? 5 ??? 5 ??????? 00000101 ???
    11111011 ???????
  • ??????????? n ??? ??????????????????????????????
    ??? ?????????? (2n-1) ??? (2n-1- 1)

34
n 2
  • binary decimal
  • 00 0
  • 01 1
  • 10 -2
  • 11 -1

35
n 3
  • binary decimal
  • 000 0
  • 001 1
  • 010 2
  • 011 3
  • 100 -4
  • 101 -3
  • 110 -2
  • 111 -1

36
FLOATING 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

38
IEEE standard
39
IEEE standard
40
IEEE 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

43
Binary Code Decimal (BCD)
  • Packed BCD
  • Unpacked BCD

44
BCD
  • ??? 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

45
Unpacked BCD
  • ???????????????????????????? 0000
    ???????????????????? BCD ???????? ???? decimal
    1234 ?????? Unpacked BCD ?????? 0000 0001 0000
    0010 0000 0011 0000 0100

46
Packed 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
48
INSTRUCTION
  • ???????????????????????
  • CPU ???????????????????????????????????????
    (machine language) ???????? ??????????????????????
    ?????????????? ????????????????????????????? ???
    ????????????? (operation code) ?????????? ???
    ??????????????? (operands) ??????????????
    ????????????????????

49
INSTRUCTION
  • ????????????? ???? ???, ??, ???, ???? ???
    ??????? ???????????? ???????? ???????????????????
    ???????????????????????????? ?????????????????????
    ????????????? ???????? immediate operand ????
    ???????????? ? ?????????????????????????????
    ???????? register operand ???? ???????????????????
    ????????????????????????????????????

50
INSTRUCTION
  • ???????
  • ??????????????? ?????????????????????????????????
    ???????????? ????
  • ??????????? ?????????????
  • 011 100 101 ADD A,B

51
INSTRUCTION
  • CPU ???????????????????????? ?????????????
    ??????????????????????? ? ??????? ??????????? ?
    ???? ????????????????????? X (AB)(C/D)-10
    ??????????????????????????????????????????????????
    ???? ??????????????????????????????????
    ?????????? ???
  • T1AB
  • T2C/D
  • T3T1T2
  • XT3-10

52
INSTRUCTION
  • ???????????????????????????????????
    ?????????????????????? ???? ??????????????????????
    ??????????????, ???????????????????????????????
    ???????????????????????????????? ??????? ????
    ?????????????????????????????? ??????

53
INSTRUCTION
  • ???????????????????????
  • ?????????????????????????????? 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

55
INSTRUCTION
  • ????????????????????
  • ?????????????????????????????? 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

56
INSTRUCTION
  • ?????????????????????????
  • ?????????????????????????????? 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 ???????????????????
Write a Comment
User Comments (0)
About PowerShow.com