-
Notifications
You must be signed in to change notification settings - Fork 0
/
token_rings.v
40 lines (39 loc) · 881 Bytes
/
token_rings.v
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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 28.10.2024 22:17:28
// Design Name:
// Module Name: token_rings
// Project Name:
// Target Devices:
// Tool Versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
`include "param.v"
module token_rings #(parameter N = 4)(
input clk,
input en,
input [`N-1:0] datain,
output reg [`N-1:0] data
);
reg temp;
always @(posedge clk) begin
if (en == 1'b1) begin
temp = datain[0];
data <= {temp, datain[`N-1:1]};
// $display("in always block");
end
else begin
data <= datain;
end
end
endmodule