⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alu.v

📁 A Relatively Simple RISC CPU 设计源码并附详细的说明文档。可以ModelSim进行仿真
💻 V
字号:
module alu (alu_out, zero, data, accum, alu_clk, opcode);output [7:0]alu_out;output zero;input [7:0] data, accum;input [2:0] opcode;input alu_clk;reg [7:0] alu_out;parameter 		            HLT  =3'b000,            SKZ  =3'b001,            ADD  =3'b010,            ANDD =3'b011,            XORR =3'b100,            LDA  =3'b101,            STO  =3'b110,            JMP  =3'b111;assign zero = !accum;always @(posedge alu_clk)   begin        casex (opcode)	         HLT: alu_out<=accum;         SKZ: alu_out<=accum;         ADD: alu_out<=data+accum;         ANDD: alu_out<=data&accum;         XORR: alu_out<=data^accum;         LDA: alu_out<=data;         STO: alu_out<=accum;         JMP: alu_out<=accum;      default: alu_out<=8'bxxxx_xxxx;      endcase   endendmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -