-
Notifications
You must be signed in to change notification settings - Fork 0
/
PISO11.v
33 lines (27 loc) · 897 Bytes
/
PISO11.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
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Author: Brandon Torres
// Email: [email protected]
// Filename: PISO11.v
//
// Notes: The register is an eleven bit register that can be loaded with
// serial in and parallel in. The LSB of the data is the output of the
// register.
//////////////////////////////////////////////////////////////////////////////////
module PISO11(clk,reset,shift,ld,Din,SDI,SDO,Data);
input clk, reset, shift, ld, SDI;
input [10:0] Din;
output wire SDO;
output reg [10:0] Data;
//Register that holds 11bits and shifts left in SDI when shift is enabled
always @(posedge clk, negedge reset)
if (!reset)
Data <= 10'b1111111111;
else if(ld)
Data <= Din;
else if(shift)
Data <= {SDI,Data[10:1]};
else
Data <= Data;
assign SDO = Data[0];
endmodule