-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathWrite_Back_Block.v
More file actions
executable file
·42 lines (39 loc) · 1.99 KB
/
Write_Back_Block.v
File metadata and controls
executable file
·42 lines (39 loc) · 1.99 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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 15:04:09 09/01/2017
// Design Name:
// Module Name: Write_Back_Block
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module Write_Back_Block(
output reg [7:0] ans_wb,
input [7:0] ans_dm,
input clk,
input reset
);
///////////////////////////////////////////////////////////////////////////////////Declarations/////////////////////////////////////////////////////////////////////////////////////////
wire[7:0] ans_wb_temp;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////Combinational Block////////////////////////////////////////////////////////////////////////////////////////////
assign ans_wb_temp = (reset == 1'b0) ? 8'b0000_0000 : ans_dm; // Value to be scanned at next clock edge
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////Sequential Block//////////////////////////////////////////////////////////////////////////////////////
always@(posedge clk)
begin
ans_wb <= ans_wb_temp; // Scanning the value at positive clock edge
end
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
endmodule