第二章 单片机基础知识 清华洪伟.ppt

第二章 单片机基础知识 清华洪伟

第二章 单片机基础知识 多(4)位加/减法电路 设二个加数分别为:A , B 和/差为 : S 利用补码变减法为加法: [A–B]补= [A]补+[-B]补= [A]补+[B]补+ 1 求[B]补--可控反相门(P32)和 加/减控制端 电路 P33 Page * From Logical to sequential Flip-flops C D Q Q` 0 X NO change 1 0 0 1 1 1 1 0 Flip-flop has the capability to STORE data It is the basic element for sequential logic. D CLK Q Q Department of Communication Engineering, Jilin University Page * Combination of Logic elements 4bit Shift register D C Q Q D C Q Q D C Q Q D C Q Q Clk D0 D1 D2 D3 Q0 Q1 Q2 Q3 Clk D0 Q0 Q1 Q2 Q3 0 X No change 1 X D0 Q0 Q1 Q2 Department of Communication Engineering, Jilin University Page * A conceptual CPU 加减 左移 右移 与或 多路开关 C B A S0 S1 S2 S3 Department of Communication Engineering, Jilin University Page * The operation of conceptual CPU S3 S2 S1 S0 C = 0 C = 1 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 Transfer F = A F = A+1 Add F = A + B F = A + B + 1 Sub F = A – B – 1 F = A – B Dec F = A – 1 And F = A ^ B Or F = A | B Not F = -A Compliment F = !A F = Logical shift right A F = Rotate shift right A F = Rotate shift right A with Carry F = Arithmetic shift right A F = Logical shift left A F = Rotate shift left A F = Rotate shift left A with Carry F = Arithmetic shift left A Department of Communication Engineering, Jilin University Lecture3 Page * 单片机的认识与实践 Outline MCU Structure The CPU Registers file (寄存器组) Instruction latch/decode/branch (指令) Stack(栈) Interrupt(中断) Clock/Reset(时钟/复位) Memory peripheral Lecture3 Page *

文档评论(0)

1亿VIP精品文档

相关文档