- 博客(11)
- 收藏
- 关注
原创 计算机组成原理实验8,9,10:CPU设计
R型指令CPU设计module R_CPU( input clk,rst, output reg [31:0]PC, output [31:0]new_PC, output [5:0] OP,func, output [4:0] rs,rt,rd,shamt, output reg [2:0] ALU_OP, output [31:0] ALU_F,A,B, output reg R_ZF,R_OF, output [31:0] Inst_code ); wire ZF,
2021-09-25 12:49:05 900
原创 计算机组成原理实验7:取指令与指令译码
COE文件memory_initialization_radix=16;memory_initialization_vector=00004827,0009502b,012a5822,012b6022,014c6820,01a97004,01ad7804,01eac020,030bc825,01798826,01d89024,02299820,0253a025,01b1a804,02b1b004,016eb820,012af820,00000820,00010fff,20006789,ffff0000,
2021-09-24 17:40:20 1292
原创 计算机组成原理实验5:存储器
COE文件memory_initialization_radix=16;memory_initialization_vector=00000820,00632020,00010fff,20006789,FFFF0000,0000FFFF,88888888,99999999,aaaaaaaa,bbbbbbbb;ALU、寄存器、存储器连接module Top( input [4:0] R_Addr_A, //左操作数地址 input [4:0] R_Adde_B, //查看寄存器中的数据 inp
2021-09-24 17:35:36 784
原创 计算机组成原理实验4:寄存器堆
寄存器堆module Register( input [4:0] R_Addr_A, input [4:0] R_Addr_B, input [4:0] W_Addr, input Write_Reg, input [31:0] Write_Data, input clk, input reset, output [31:0] R_Data_A, output [31:0] R_Data_B ); reg [31:0] REG [0:31]; //Write int
2021-09-24 17:31:33 2676
原创 计算机组成原理实验3:多功能ALU
代码段module ALU( input [2:0] ALU_OP, input [31:0] A,B, output reg [31:0] F, output reg ZF,OF,SF,PF,CF ); reg C; always@(*) begin OF = 1'b0; CF = 1'b0; case(ALU_OP) 3'b000: begin F = A&B; end 3'b001: begin F = A|B; end 3'b010
2021-09-24 17:24:39 779
原创 计算机组成原理实验1:全加器
1位全加器module Full_Adder_1bit( input A,B,Cin, output F,Cout ); assign F = A^B^Cin; assign Cout = (A&B)|(A^B)&Cin;endmodule4位全加器module Full_Adder_4bit(Sum,Cout,X,Y,Cin); output[3:0] Sum; output Cout; input [3:0] X,Y; input
2021-09-24 17:20:01 2211
原创 数电实验23:按键消抖
代码段module Top( input rst, input CLK, input Key, output reg l1, output reg l2, output reg l3, output reg l4, output reg l5, output reg l6, output reg l7, output reg l8 ); wire c1,key_p; wire o1,o2,o3,o4,o5,o6,o7,o8; Fdiv uu1(rst,CLK,32
2021-09-24 17:05:57 753
原创 数电实验17:流水灯
代码段module Water( input [1:0]SW, input CLK, input rst, output reg [7:0] LED ); wire CLK_1HZ; reg [1:0] LS; div uu1(CLK,rst,CLK_1HZ); initial begin LED <= 8'b0; end always @(posedge rst or posedge CLK_1HZ) begin
2021-09-24 17:01:17 1903 1
原创 数电实验18:数码管扫描显示
代码段module Top( input ST, input CLR, input clk_25M, output [3:0] AN, output [7:0] SEG ); reg[15:0] Data; reg[3:0] Data_Show; wire[1:0] BIT_SEL; reg Increment; integer clk_num=0; delay_2ms uu1(clk_25M,BIT_
2021-09-24 16:54:34 637
原创 数电实验1:五输入表决器
代码段module WuWei(A,B,C,D,E,F); input A,B,C,D,E; output F; wire A,B,C,D,E,F; assign F=((A&B&C)||(A&B&D)||(A&B&E)||(A&C&D)||(A&C&E)||(A&D&E)||(B&C&D)||(B&C&E)||(B&D&E)||(C&D&
2021-09-24 16:46:08 2689
原创 数电实验5:数值比较器
数电实验5:数值比较器module Compare( input [3:0] A, input [3:0] B, output reg [2:0] Y ); always @ (*) begin if(A>B) Y=3'b001; else if (A==B) Y=3'b010; else Y=3'b100; endendmodule测试文件module test; // Input
2021-09-24 15:39:34 1457
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人