-
-
..._out3 <= A_BUS(15 downto 8) & lut_out;
-----------------------
-- Control Logic Unit--
-----------------------
control_logic: process(CTRL,tmp_out1,tmp_out3,tmp_out2) begin
case(CTRL(3 downto 3)) is
when "0" =>
RESULT <= tmp_out1;
when ot...
-
-
...bit ALU
ALUctrl: in std_logic_vector(3 downto 0); -- ALUctrl control input of the 16-bit ALU
ALUOUT: out std_logic_vector(15 downto 0) -- 16-bit data output of the 16-bit ALU
);
end ALU;
architecture Behavioral of ALU is
-- N-bit Adder in Verilog ...
-
-
...sp;duty_dec <= tmp3 and (not tmp4) and slow_clk_en;
-- for controlling duty cycle by these buttons
process(clk)
begin
if(rising_edge(clk)) then
if(duty_inc='1' and DUTY_CYCLE <= x"9") then
DUTY_CYCLE <= DUTY_CYCLE + x"1";-...
-
-
...re [15:0] sign_ext_im,read_data2,zero_ext_im,imm_ext;
wire JRControl;
wire [2:0] ALU_Control;
wire [15:0] ALU_out;
wire zero_flag;
wire signed[15:0] im_shift_1, PC_j, PC_beq, PC_4beq,PC_4beqj,PC_jr;
wire beq_control;...
-
-
...ects, Verilog projects
// Verilog project: Verilog code for traffic light controller
module traffic_light(light_highway, light_farm, C, clk, rst_n);
parameter HGRE_FRED=2'b00, // Highway green and farm red
HYEL_FRED = 2'b01,// Highway yellow and farm red
HRED_FGRE=2'b1...
-
-
...bsp; SLT ws, rs1, rs2 ws:=1 if rs1 < rs2; ws:=0 if rs1 ≥ rs2 C. Control Flow Instructions 1. Branch on Equal: BEQ rs1, rs2, offset Branch to (PC + 2 + (offset << 1)) when rs1 ...