设计与验证verilog hdl

源代码在线查看: if_mult_decode.v

软件大小: 1828 K
上传用户: NJ_WK
关键词: verilog hdl
下载地址: 免注册下载 普通下载 VIP

相关代码

				// Use case statement to build decode circuit without prior
				
				`timescale 1ns/1ps
				module if_mult_decode (addr_H, CS1, CS2, CS3, CS4);
				input  [2:0] addr_H;
				output       CS1, CS2, CS3, CS4;
				reg    [3:0] CS_bus;
				
				parameter CHIP1 = 3'b100,
				          CHIP2 = 3'b101,
				          CHIP3 = 3'b010,
				          CHIP4 = 3'b011;
				
				     always @ (addr_H)
					  begin 
					      CS_bus = 4'b1111;                
				              if (addr_H == CHIP1)
				                  CS_bus = 4'b0111;
				              if (addr_H == CHIP2)
				                  CS_bus = 4'b1011;
				              if (addr_H == CHIP3)
				                  CS_bus = 4'b1101;
				              if (addr_H == CHIP4)
				                  CS_bus = 4'b1110;
				          end
				
				assign CS4 = CS_bus [3];
				assign CS3 = CS_bus [2];
				assign CS2 = CS_bus [1];
				assign CS1 = CS_bus [0];
				
				endmodule			

相关资源