Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F629375
asycnreset_Binary_6.v
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
asycnreset_Binary_6.v
View Options
module
fsm
(
input
wire
clk
,
input
wire
reset
,
input
wire
in
,
output
wire
out
);
// Define state encoding using parameters
parameter
S0
=
3
'b000
,
S1
=
3
'b001
,
S2
=
3
'b010
,
S3
=
3
'b011
,
S4
=
3
'b100
,
S5
=
3
'b101
;
reg
[
2
:
0
]
state
,
next_state
;
// 3-bit state register
// Sequential block: state transitions on clock or reset
always
@(
posedge
clk
or
posedge
reset
)
begin
if
(
reset
)
state
<=
S0
;
// Reset to S0
else
state
<=
next_state
;
end
// Combinational block: next state logic
always
@(
*
)
begin
case
(
state
)
S0:
next_state
=
in
?
S1
:
S0
;
S1:
next_state
=
in
?
S2
:
S1
;
S2:
next_state
=
in
?
S3
:
S2
;
S3:
next_state
=
in
?
S4
:
S3
;
S4:
next_state
=
in
?
S5
:
S4
;
S5:
next_state
=
S0
;
// Cycle back to S0 after S5
default
:
next_state
=
S0
;
// Safe default in case of illegal state
endcase
end
// Combinational block: output logic
assign
out
=
(
next_state
==
S5
);
endmodule
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 15, 12:39 PM (15 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
252813
Default Alt Text
asycnreset_Binary_6.v (1 KB)
Attached To
Mode
R231 SoC_I-Edge_yosys_nem_optimization
Attached
Detach File
Event Timeline
Log In to Comment