14MachineStruSTATE

上传人:无*** 文档编号:200760432 上传时间:2023-04-17 格式:PPT 页数:27 大小:2.79MB
收藏 版权申诉 举报 下载
14MachineStruSTATE_第1页
第1页 / 共27页
14MachineStruSTATE_第2页
第2页 / 共27页
14MachineStruSTATE_第3页
第3页 / 共27页
资源描述:

《14MachineStruSTATE》由会员分享,可在线阅读,更多相关《14MachineStruSTATE(27页珍藏版)》请在装配图网上搜索。

1、One Laptop per Child The OLPC project has beenmaking news recently with its$100 Linux laptop intended for every child on earth.Libya just purchased 1.2 million of them(powered by a wind-up crank).Cool!Machine Structures Lecture 14 State Elements:Circuits that Remember laptop.org复习复习ISA是非常重要的一层抽象是非常重

2、要的一层抽象硬件与软件间的协议硬件与软件间的协议时钟控制电路的脉冲时钟控制电路的脉冲电压是模拟量电压是模拟量analog,量化为量化为 0/1电路的延时是生活中不可避免的电路的延时是生活中不可避免的fact of life两种类型的电路两种类型的电路:无状态组合逻辑无状态组合逻辑(&,|,)状态电路状态电路(如如,寄存器寄存器)Intro to hardware description languageVerilog Hardware Description LanguageVery Brief Verilog Introduction Verilog Example:4-input mult

3、iplexor Verilog Example:AccumulatorLast word(for now)on Verilog状态单元的用途状态单元的用途1.用于存储数值,存储时间是不定的用于存储数值,存储时间是不定的:寄存器文件寄存器文件(如如MIPS中的中的$1-$31)存储器存储器(caches和主存和主存)2.帮助控制组合逻辑块间的信息流动帮助控制组合逻辑块间的信息流动.状态单元用于保存组合逻辑块的输入端的状态单元用于保存组合逻辑块的输入端的信息流动,以允许其有序地经过信息流动,以允许其有序地经过.累加器示例累加器示例希望希望:S=0;for(i=0;in;i+)S=S+Xi为何需要控

4、制信息流动呢?假定假定:每个每个 X 值逐个地输入,每周期一个值逐个地输入,每周期一个.n 周期之后,和出现在周期之后,和出现在S端端.First tryDoes this work?无法工作无法工作Nope!原因原因#1 如何控制如何控制 for 循环的下一次迭代循环的下一次迭代?原因原因#2 如何表示如何表示:S=0?FeedbackSecond tryHow about this?RoughtimingRegister is used to hold up the transfer of data to adder.寄存器细节寄存器细节内部结构内部结构?N个翻转器个翻转器“Flip-Fl

5、op”Flip-flop 名字的由来:因为其值在名字的由来:因为其值在0和和1间翻来翻间翻来翻去去 D 是是“data”,Q 是是“output”也称为也称为“d-type Flip-Flop”Flip-flop的时序是什么样的的时序是什么样的?(1/2)边沿触发(边沿触发(Edge-triggered)d-type flip-flop这是这是“正正边沿触发边沿触发”“在时钟信号的上升沿在时钟信号的上升沿,获得获得d的样值,并传给输出的样值,并传给输出.其它其它时间时间,忽略输入忽略输入d的值的值.”波形示例波形示例:Whats the timing of a Flip-flop?(2/2)边

6、沿触发边沿触发 d-type flip-flop这是这是“正正边沿触发边沿触发”“在时钟信号的上升沿在时钟信号的上升沿,获得获得d的样值,并传给输的样值,并传给输出出.其它时间其它时间,忽略输入忽略输入d的值的值.”波形示例波形示例:Accumulator Revisited(proper timing 1/2)Reset input to register is used to force it to all zeros(takes priority over D input).Si-1 holds the result of the ith-1 iteration.Analyze circ

7、uit timing starting at the output of the register.Accumulator Revisited(proper timing 2/2)reset signal shown.Also,in practice X might not arrive to the adder at the same time as Si-1Si temporarily is wrong,but register always captures correct value.In good circuits,instability never happens around r

8、ising edge of clk.Pipelining to improve performance(1/2)时间时间添加更多的寄存器来加速时钟频率.Note:delay of 1 clock cycle from input to output.Clock period limited by propagation delay of adder/shifter.Pipelining to improve performance(2/2)TimingInsertion of register allows higher clock frequency.More outputs per sec

9、ond.有限状态机有限状态机(FSM)介绍介绍有限状态机的原理有限状态机的原理功能可以用功能可以用“状态变换状态变换图图”表示表示.有限状态机可以用组有限状态机可以用组合逻辑和寄存器等硬合逻辑和寄存器等硬件实现件实现.有限状态机示例有限状态机示例:连续连续3个个1FSM图图输出端连续出现3个1的有限状态机假定状态变换由时钟控制,在每个时钟周期,机器检查输入,并转换到一个新的状态,且产生新的输出Hardware Implementation of FSM+=?Therefore a register is needed to hold the a representation of which

10、state the machine is in.Use a unique bit pattern for each state.Combinational logic circuit is used to implement a function maps from present state and input to next state and output.Hardware for FSM:Combinational LogicPSInputNSOutput000000001010010000011100100000101001Truth tableNext lecture we wil

11、l discuss the detailed implementation,but for now can look at its functional specification,truth table form.General Model for Synchronous SystemsCollection of CL blocks separated by registers.Registers may be back-to-back and CL blocks may be back-to-back.Feedback is optional.Clock signal(s)connects

12、 only to clock input of registers.Peer InstructionA.HW feedback akin to SW recursionB.We can implement a D-Q flipflop as simple CL(And,Or,Not gates)C.You can build a FSM to signal when an equal number of 0s and 1s has appeared in the input.ABC1:FFF2:FFT3:FTF4:FTT5:TFF6:TFT7:TTF8:TTTPeer Instruction

13、AnswerA.HW feedback akin to SW recursionB.We can implement a D-Q flipflop as simple CL(And,Or,Not gates)C.You can build a FSM to signal when an equal number of 0s and 1s has appeared in the input.ABC1:FFF2:FFT3:FTF4:FTT5:TFF6:TFT7:TTF8:TTTA.It needs base case(reg reset),way to step from i to i+1(use

14、 register+clock).True!B.D-Q has state,CL never has state!False!C.How many states would it have?Say its n.How does it know when n+1 bits have been seen?False!“And In conclusion”Verilog is used to describe and simulate hardwareSimple subset used in this classState elements are used to:Build memoriesControl the flow of information between other state elements and combinational logicD-flip-flops used to build registersClocks tell us when D-flip-flops changeSetup and Hold times importantWe pipeline long-delay CL for faster clockFinite State Machines extremely useful

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!