实验研究报告模板.docxVIP

  • 11
  • 0
  • 约1.32万字
  • 约 19页
  • 2018-11-15 发布于江苏
  • 举报
实验研究报告模板

同济大学 计算机科学与技术系 计算机组成原理课程实验报告 学 号 1452312 姓 名 冯凯 专 业 计算机科学与技术 授课老师 王力生 日 期 2016.06.18 实验目标 1、熟悉Verilog语言的编写。 2、掌握计算机的每个部件的构成逻辑及工作原理,计算机各部件之间的连接逻辑,计算机整机的工作原理。 3、掌握CPU功能。 4、设计55条单周期指令CPU下板成功 2、.在自己的CPU上跑一个汇编程序 总体设计 作品功能设计及原理说明 module comp( input clock, input resetn, output [2:0] r, output [2:0] g, output [1:0] b, output hs, output vs, ); 硬件逻辑图 主要模块设计 1.ALU module alu( input [31:0] a, input [31:0] b, input [3:0] aluc, output [31:0] r, output zero,//零标志 output carry, // 进位标志位 output negative, // 负数标志位 output overflow // 溢出标志位 ); wire [31:0] d_and = ab;//0100 wire [31:0] d_or = a|b;//0101 wire [31:0] d_xor = a^b;//0110 wire [31:0] d_nor = ~(a|b);//0111 wire [31:0] d_lui = {b[15:0],16h0};//100x wire [31:0] d_slt = ab?1:0; wire [31:0] d_sltu = (a[31]~b[31])||(a[31]b[31]ab)||(~a[31]~b[31]ab); wire [31:0] d_and_or = aluc[0]?d_or:d_and; wire [31:0] d_xor_nor = aluc[0]?d_nor:d_xor; wire [31:0] d_and_or_xor_nor = aluc[1]?d_xor_nor:d_and_or; wire [31:0] d_slt_sltu = aluc[0]?d_slt:d_sltu; wire [31:0] d_lui_slt_sltu = aluc[1]?d_slt_sltu:d_lui; wire [31:0] d_as; wire [31:0] d_sh; wire carry_as; wire negative_as; wire overflow_as; wire carry_sh; addsub32 as32(a,b,aluc[0],aluc[1],d_as,carry_as,overflow_as); shift shifter(b,a[4:0],~aluc[1],~aluc[0],d_sh,carry_sh); mux4x32 select_d(d_as,d_and_or_xor_nor,d_lui_slt_sltu,d_sh,aluc[3:2],r); mux4x1 select_carry(carry_as,1b0,1b0,carry_sh,aluc[3:2],carry); mux4x1 select_overflow(overflow_as,1b0,1b0,overflow_sh,aluc[3:2],overflow); assign zero = ~|r; assign negative = r[31]; endmodule 2.regfile module regfile( input [4:0] raddr1, input [4:0] raddr2, input [31:0] wdata, input [4:0] waddr, input we, input clk, input rst, output [31:0] radata1, output [31:0] radata2 ); reg [31:0]

文档评论(0)

1亿VIP精品文档

相关文档