Encapsulation Abstraction Different Instruction Set Different Computer(Type) Far more CISC Vs RISC atomic operations 7800 Clear AC are 7400 Clear E ComplementAC Complement E 7080 Circulate right AC and E 7040 Circulate left AC and E provided by 翻 7020 IncrementAC 7010 Skip next instr.if AC is positive 7008 Skip next instr.if AC is negative 7004 Skip next instr.if AC is zero 7002 Skip next instr.if E is zero 7001 Halt computer computers IN F800 UT Input character to Ac F400 Output character from AC F200 Skip on input flag F100 Skip on output flag 18 F080 Interrupt on F040 Interrupt off Computer Organization Computer Architectures Lab 11
2022/12/14 11 Encapsulation + Abstraction Far more atomic operations are provided by computers Different Instruction Set Different Computer (Type)
CISC VS RISC A=A*B A CISC processor would come prepared with a A RISC processor only use simple instructions that specific instruction (we call it "MULT").When can be executed within one clock cycle.Thus,the executed,this instruction “MULT”command could be divided into three 1.Loads the two values into separate registers separate commands: 2.Multiplies the operands in the execution unit 1.“LOAD”moves data from memory to a register 2."PROD"finds the product of two operands located 3.Stores the product in the appropriate register. within the registers 3.“STORE”moves data from a register to memory. Thus,the task of multiplying two numbers can be completed with one instruction: The task of multiplying two numbers can be MULTA,B<<<==this is assembly statement completed with four lines of assembly: LOAD R1,A <<<==this is assembly statement MULT is what is known as a "complex LOAD R2,B <<<==this is assembly statement instruction.” PROD A,B<<<==this is assembly statement STORE R3,A <<<==this is assembly statement 2022/12/14 12
2022/12/14 12 CISC VS RISC A=A*B A CISC processor would come prepared with a specific instruction (we call it “MULT”). When executed, this instruction 1.Loads the two values into separate registers 2.Multiplies the operands in the execution unit 3.Stores the product in the appropriate register. Thus, the task of multiplying two numbers can be completed with one instruction: MULTA,B <<<==this is assembly statement MULT is what is known as a “complex instruction.” A RISC processor only use simple instructions that can be executed within one clock cycle. Thus, the “MULT” command could be divided into three separate commands: 1.“LOAD” moves data from memory to a register 2.“PROD” finds the product of two operands located within the registers 3.“STORE” moves data from a register to memory. The task of multiplying two numbers can be completed with four lines of assembly: LOAD R1, A <<<==this is assembly statement LOAD R2,B <<<==this is assembly statement PROD A, B <<<==this is assembly statement STORE R3, A <<<==this is assembly statement
Encapsulation Abstraction C C=A+B; C++ JAVA High Level Language Program at different ADD A,B Assembly Language abstraction level 100100111 Machine Language ☑ Hardware
2022/12/14 13 Encapsulation + Abstraction Program at different abstraction level
An Example to Calculate x-y movl 8(号ebp),号edx;取x的值 int absdiff(int x,int y) movl 12(号ebp),号eax;取y的值 { cmpl号eax,号edx ;比较x和y的值 j1.L3 ;如果y<x 转到.L3 if (x y) subl号eax,号edx ;计算y-x return y-x; movl号edx,号eax :返回值 jmp.L5 ;跳转到.工5 else .L3: iy<x return x -y; subl edx,eax;计算x-y .L5: :完成 2022/12/14 14
int absdiff(int x, int y) { if (x < y) return y - x; else return x - y; } 2022/12/14 14 An Example to Calculate 𝒙 − 𝒚 movl 8(%ebp),%edx ;取x的值 movl 12(%ebp),%eax;取y的值 cmpl %eax,%edx ;比较x和y的值 jl .L3 ;如果y<x 转到.L3 subl %eax,%edx ;计算y-x movl %edx,%eax ;返回值 jmp .L5 ;跳转到.L5 .L3: ;y<x subl %edx,%eax ;计算x-y .L5: ;完成
The ESSENCE The outward appearance It is the bits that"sense"the external stimuli is of arriving from the outside world via buttons,levers, keys on a keyboard,electronic communication lines, peripheral and even microphones and cameras. importance when compared to It is the bits that“decide”how to react to these the bits and stimuli and respond accordingly by directing other stimuli to the outside via displays,screens,printers, their internal loudspeakers,beepers,levers,and cranks. arrangement 15
2022/12/14 15 The ESSENCE The outward appearance is of peripheral importance when compared to the bits and their internal arrangement It is the bits that “sense” the external stimuli arriving from the outside world via buttons, levers, keys on a keyboard, electronic communication lines, and even microphones and cameras. It is the bits that “decide” how to react to these stimuli and respond accordingly by directing other stimuli to the outside via displays, screens, printers, loudspeakers, beepers, levers, and cranks