Advertisement
MBJ

Mux C

MBJ
Apr 22nd, 2019
1,305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. `timescale 1ns / 1ps
  2.  
  3. module MUX_C(
  4.             input [31:0] BrA, RAA, PC_1,    // check the PC +1, comes from IF phase
  5.             input [1:0] MC, // comes from combinational circuit from top phase, should be inputted into register in TOP_PHASE VERILOG MODULE
  6.             output reg [31:0] PC    // this straight up drives the PC register in the top top module
  7.             );
  8.  
  9. // always @ to make case statement instead of ?:'s
  10. always@(*) begin
  11.     case(MC)
  12.         0: PC = PC_1;   // most used case
  13.         1,2: PC = BrA;
  14.         3: PC = RAA;
  15.         default: PC = PC_1;
  16.     endcase // PC's here are always driving (async), on top phase module, its PC is set on negedge
  17. end
  18.  
  19. endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement