当前位置:文档之家› 计组实验报告

计组实验报告

计算机组成原理实验报告实验1:VERILOG 设计基础专业班级:14级计算机二班学号:14048001 姓名:杨娜学号:14048003 姓名:周蓉实验地点:理工楼901 实验时间:2016年5月14日实验十VGA显示控制器的设计一、实验目的1、学习VERILOG的基本语法和编程规则2、掌握通用寄存器等常用基本数字模块的VERILOG描述和基本设计方法3、理解带使能控制和异步清零的8位寄存器的设计原理4、掌握使用VERILOG设计和验证带使能控制和异步清零的8位寄存器的方法5、掌握移位寄存器的设计方法二、实验任务1、设计一个带使能控制和异步清零的8位寄存器REG8X,实现8位输入的锁存,在时钟的上升沿处得到一个8位的输出和一个8位的反向输出,将结果显示在发光二极管。

模块的端口描述如下:模块的参考物理结构如下:R7 R6 R i R 07 6 i 0带使能控制和异步清零的8位寄存器模块的使用注意事项1.数据源D(7..0)一直加在寄存器的数据输入端;2.周期性的时钟信号Clock一直加在寄存器的时钟输入端3.使能信号Enable控制寄存器是否接受数据。

当Enable = '0'时,寄存器不接受数据,保持原来的状态不变;当Enable = '1'时,在时钟信号Clock正跳变时,寄存器接受并保存当时D(7..0)的数据;4.本寄存器其它方面的功能与上述的寄存器相同。

完成的参考电路图如下:dout=q2、设计一个有左、右移位功能的8位寄存器REGSHIFT8,并仿真验证。

三、实验内容1、通过输入数据先进行计算,并通过实验进行验证REG8X。

(1)、将清零信号Resetn(sw17)设为0,将输入信号D(sw7~sw0)设为10101010,观察输出信号Q(ledr7~ledr0)和Qb(ledg7~ledg0),观察并记录输出。

(2)、将清零信号Resetn(sw17)设为1,在时钟信号处输入一个上升沿(按下key0),观察并记录输出。

(3)、将输入信号D(sw7~sw0)设为01010101,观察并记录输出。

(4)、在时钟信号处输入一个上升沿(按下key0),观察并记录输出。

(5)、自行完善设计表格,观察并记录测试输出。

实验数据表2、通过输入数据先进行计算,并通过实验进行验证REGSHIFT8。

(1)、测试清零信号Resetn(2)、测试移位功能(3)、测试寄存功能(4)、自行设计表格观察并记录测试输出。

实验数据表三、实验仪器及设备:1、PC机2、QuartusⅡ 9.03、DE2-704、显示器四、实验步骤1、编写VERILOG代码2、功能仿真进行分析与综合,排除语法上的错误建立波形仿真文件,输入激励生成功能仿真网表进行功能仿真,观察输出结果3、选择器件DE2_115开发板的使用者请选择CYCLONE IV 4CE1154、绑定管脚5、下载验证DE2_115开发板的下载:使用USB-Blaster进行下载代码如下:1、带使能控制和异步清零的8位寄存器module lab1_Preg#(parameter WEISHU=8)(input rL,input clk,input cclr,input control,input [WEISHU-1:0] d,output [WEISHU-1:0] dout);wire [WEISHU-1:0] w_0;wire [WEISHU-1:0] w_1;wire [WEISHU-1:0] w_2;wire w_3;reg [WEISHU-1:0] w_dff;assign w_2=w_0|w_1;assign dout=(control)?(w_dff):{(WEISHU-1){1'bz}}; always@(posedge clk or negedge cclr)beginif(!cclr)w_dff<=0;elsew_dff<=w_2;endassign w_0=d & {(WEISHU-1){rL}};assign w_1={(WEISHU-1){w_3}} & w_dff;assign w_3=~rL;endmodule2、有左、右移位功能的8位寄存器module jicunqi(reset,clk,mode,d,q,lin,lout,rin,rout); input reset;input clk;input [1:0]mode;input [7:0]d;input lin;input rin;output [7:0]q;output lout;output rout;wire [1:0] mode;reg [2:0]countl=3'b000;reg [2:0]countr=3'b000;reg [7:0]q,lout,rout;always @(posedge clk or negedge reset)beginif(!reset)q<=0;elsebegincase(mode)2'b01:if(lin)beginif(countl>3'b111)countl=3'b111;countl=countl+3'b001;q=d<<countl;lout<=q[7];end2'b10:if(rin)beginif(countr>3'b111)countr=3'b111;countr=countr+3'b001;q=d>>countr;rout<=q[7];enddefault: q<=d;endcaseendendendmodule引脚分配如下:1、带使能控制和异步清零的8位寄存器set_location_assignment PIN_Y23 -to cclrset_location_assignment PIN_M23 -to clkset_location_assignment PIN_Y24 -to controlset_location_assignment PIN_AB26 -to d[7]set_location_assignment PIN_AD26 -to d[6]set_location_assignment PIN_AC26 -to d[5]set_location_assignment PIN_AB27 -to d[4]set_location_assignment PIN_AD27 -to d[3]set_location_assignment PIN_AC27 -to d[2]set_location_assignment PIN_AB28 -to d[0]set_location_assignment PIN_H19 -to dout[7] set_location_assignment PIN_J19 -to dout[6] set_location_assignment PIN_E18 -to dout[5] set_location_assignment PIN_F18 -to dout[4] set_location_assignment PIN_F21 -to dout[3] set_location_assignment PIN_E19 -to dout[2] set_location_assignment PIN_F19 -to dout[1] set_location_assignment PIN_G19 -to dout[0] set_location_assignment PIN_G21 -to qb[7]set_location_assignment PIN_G22 -to qb[6]set_location_assignment PIN_G20 -to qb[5]set_location_assignment PIN_H21 -to qb[4]set_location_assignment PIN_E24 -to qb[3]set_location_assignment PIN_E25 -to qb[2]set_location_assignment PIN_E22 -to qb[1]set_location_assignment PIN_E21 -to qb[0]set_location_assignment PIN_AA22 -to rL2、有左、右移位功能的8位寄存器set_location_assignment PIN_M23 -to clkset_location_assignment PIN_AB26 -to d[7]set_location_assignment PIN_AD26 -to d[6]set_location_assignment PIN_AC26 -to d[5]set_location_assignment PIN_AB27 -to d[4]set_location_assignment PIN_AD27 -to d[3]set_location_assignment PIN_AC27 -to d[2]set_location_assignment PIN_AC28 -to d[1]set_location_assignment PIN_AB28 -to d[0]set_location_assignment PIN_AA23 -to linset_location_assignment PIN_Y24 -to mode[1] set_location_assignment PIN_AA22 -to mode[0] set_location_assignment PIN_AA24 -to rinset_location_assignment PIN_H19 -to lout[7]set_location_assignment PIN_J19 -to lout[6]set_location_assignment PIN_E18 -to lout[5]set_location_assignment PIN_F18 -to lout[4]set_location_assignment PIN_F21 -to lout[3]set_location_assignment PIN_E19 -to lout[2]set_location_assignment PIN_F19 -to lout[1]set_location_assignment PIN_G19 -to lout[0]set_location_assignment PIN_G21 -to rout[7]set_location_assignment PIN_G22 -to rout[6]set_location_assignment PIN_G20 -to rout[5]set_location_assignment PIN_H21 -to rout[4]set_location_assignment PIN_E24 -to rout[3]set_location_assignment PIN_E25 -to rout[2]set_location_assignment PIN_E22 -to rout[1]set_location_assignment PIN_E21 -to rout[0]set_location_assignment PIN_J17 -to q[0]set_location_assignment PIN_G17 -to q[1]set_location_assignment PIN_J15 -to q[2]set_location_assignment PIN_H16 -to q[3]set_location_assignment PIN_J16 -to q[4]set_location_assignment PIN_H17 -to q[5]set_location_assignment PIN_F15 -to q[6]set_location_assignment PIN_G15 -to q[7]五、实验心得从数字电路到计算机组成原理,做了这么多次实验,我觉得实验过程中最重要的就是细心。

相关主题