-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnbitreg.v
More file actions
47 lines (41 loc) · 1.05 KB
/
nbitreg.v
File metadata and controls
47 lines (41 loc) · 1.05 KB
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
37
38
39
40
41
42
43
44
45
46
47
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 09/20/2022 09:16:17 AM
// Design Name:
// Module Name: nbitreg
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
/*******************************************************************
*
* Module: nbitreg.v
* Project: RV32
* Author: Farah Kabesh , Karim el Genidy , Omar fayed
* Description: nbit register
*
**********************************************************************/
//////////////////////////////////////////////////////////////////////////////////
module nbitreg #(parameter N = 8)(
input clk, input rst, input [N-1:0]D, input load, output [N-1:0]Q
);
wire [N-1 : 0]out;
genvar i;
generate
for(i=N-1 ; i>=0 ; i= i-1)
begin
DFlipFlop flip ( clk,rst, out[i], Q[i]);
mux m( Q[i], D[i] , load , out[i]);
end
endgenerate
endmodule