vead
Full Member level 5
hello,
I wrote code for decoder but when I compiled code I got error
error
note: I did not see any option for code table so I have pasted directly
I wrote code for decoder but when I compiled code I got error
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 module decoder (clk,rst,opcode,ram_sel,rom_sel,alu_sel,pc_sel,acc_sel,ext_rom_sel,ext_ram_sel,register_sel); input clk ; // clock input rst; // reset input opcode ; output ram_sel [7:0]; // select ram for read and write output rom_sel [7:0]; // select rom for read output alu_sel [7:0]; // select alu output pc_sel [7:0]; // select pc output acc_sel [7:0]; //select accumulator output register_sel [7:0]; //select register output ext_rom_sel[7:0]; //select rom for read output ext_ram_sel[7:0]; // select ram for read and write reg [7:0] ram_sel; reg [7:0] rom_sel; reg [7:0]alu_sel; reg [7:0] pc_sel; reg [7:0] acc_sel; reg [7:0] ext_rom_sel; reg [7:0] ext_ram_sel; reg register_sel [7:0]; always @(rst) begin case (rst) 00000000:ram_sel =00000001 ; 00000000:rom_sel =00000010 ; 00000000:alu_sel =00000100 ; 00000000:pc_sel =00001000; 00000000:acc_sel =00010000 ; 00000000:register_sel =00100000 ; 00000000:ext_rom_sel =01000000; 00000000:ext_ram_sel =10000000; endcase end endmodule
Error (10773): Verilog HDL error at decoder.v(11): declaring module ports or function arguments with unpacked array types requires SystemVerilog extensions
Error (10048): Verilog HDL error at decoder.v(31): values cannot be assigned directly to all or part of array "register_sel" - assignments must be made to individual elements only
Error: Quartus II Analysis & Synthesis was unsuccessful. 2 errors, 14 warnings
Error: Quartus II Full Compilation was unsuccessful. 4 errors, 14 warnings
note: I did not see any option for code table so I have pasted directly
Last edited by a moderator: