New Text Document
New Text Document
// State definitions
parameter S0 = 2'b00;
parameter S1 = 2'b01;
parameter S2 = 2'b10;
parameter S3 = 2'b11;
S1: begin
if (data_in)
state <= S2;
else
state <= S0;
end
S2: begin
if (data_in)
state <= S3;
else
state <= S0;
end
S3: begin
if (data_in)
state <= S3;
else
state <= S0;
end
endcase
end
end
endmodule
module USR (
input wire clk,
input wire reset,
input wire shift,
input wire [3:0] I,
output reg [3:0] O,
input wire [1:0] s,
input wire SINR,
input wire SINL
);
wire [3:0] w;
reg [2:0] shift_count;
wire data_out;
UniversalShiftRegister u1 (
.clk(clk),
.reset(reset),
.shift(shift),
.data_in(I[0]),
.data_out(data_out)
);
Mux m1 (
.sel1(s[1]),
.sel0(s[0]),
.input0(I[0]),
.input1(SINL),
.output1(O[0]),
.output0(O[1])
);
Mux m2 (
.sel1(s[1]),
.sel0(s[0]),
.input0(O[0]),
.input1(O[1]),
.output1(O[2]),
.output0(O[1])
);
Mux m3 (
.sel1(s[1]),
.sel0(s[0]),
.input0(O[1]),
.input1(O[2]),
.output1(O[3]),
.output0(O[2])
);
Mux m4 (
.sel1(s[1]),
.sel0(s[0]),
.input0(O[2]),
.input1(SINR),
.output1(SINR),
.output0(O[3])
);
dflipflop d1 (
.D(O[0]),
.CLK(clk),
.RST(reset),
.Q(w[0])
);
dflipflop d2 (
.D(O[1]),
.CLK(clk),
.RST(reset),
.Q(w[1])
);
dflipflop d3 (
.D(O[2]),
.CLK(clk),
.RST(reset),
.Q(w[2])
);
dflipflop d4 (
.D(O[3]),
.CLK(clk),
.RST(reset),
.Q(w[3])
);
assign O = w;
endmodule
module clkdividor (
input wire clk_1hz,
input wire clk,
input wire rst
);
parameter n = 25;
parameter N = 2500;
endmodule
module Mux (
input wire sel1,
input wire sel0,
input wire input0,
input wire input1,
output reg output1,
output reg output0
);
endmodule
module dflipflop (
input wire D,
input wire CLK,
input wire RST,
output reg Q
);
endmodule
//////////////////////////////
*****************************************//////////////////
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Company:
// Engineer:
//
// Create Date: 22:46:16 06/07/2023
// Design Name:
// Module Name: lab12
// Project Name:
// Target Devices:
// Tool versions:
// Description:
//
// Dependencies:
//
// Revision:
// Revision 0.01 - File Created
// Additional Comments:
//
//////////////////////////////////////////////////////////////////////////////////
module lab12 (
input wire clk,
input wire reset,
input wire data_in,
output reg sequence_detected
);
// State definitions
parameter S0 = 2'b00;
parameter S1 = 2'b01;
parameter S2 = 2'b10;
parameter S3 = 2'b11;
S1: begin
if (data_in)
state <= S2;
else
state <= S0;
end
S2: begin
if (data_in)
state <= S3;
else
state <= S0;
end
S3: begin
if (data_in)
state <= S3;
else
state <= S0;
end
endcase
end
end
endmodule
module UniversalShiftRegister (
input wire clk,
input wire reset,
input wire shift,
input wire data_in,
output wire data_out
);
endmodule
module clk_dvr (
input wire clk_1s,
input wire clk,
input wire rst
);
parameter n = 25;
parameter N = 2500;
endmodule
*********************************************///
**************************************************
In control systems, we study the principles, analysis, design, and implementation
of systems that govern the behavior of dynamic systems. Control systems are used to
manage and regulate the behavior of various devices, processes, and machines to
achieve desired outputs or performance.
Here are some of the key concepts and topics that are typically studied in control
systems:
Open-loop control: A control system where the output does not influence the control
action. The control action is predetermined based on the input.
Closed-loop control (Feedback control): The output is compared to the desired
reference signal, and the control action is adjusted accordingly. This allows the
system to correct errors and maintain stability.
Proportional (P) control: The control action is proportional to the difference
between the desired setpoint and the actual output.
Integral (I) control: The control action is proportional to the accumulation of
past errors. It helps to eliminate steady-state errors.
Derivative (D) control: The control action is proportional to the rate of change of
the error. It helps to improve transient response.
Stability Analysis: Assessing the stability of a control system to ensure it does
not oscillate or become uncontrollable. Stability is crucial for safe and reliable
system operation.
Digital Control Systems: Studying control systems implemented using digital devices
like microcontrollers or digital signal processors.
Nonlinear Control Systems: Techniques for dealing with control systems with
nonlinear dynamics, where traditional linear control methods may not be applicable.