Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F5277069
branchingmux_binary_7.v
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
branchingmux_binary_7.v
View Options
module
fsm
(
input
wire
clk
,
input
wire
reset
,
input
wire
in1
,
in2
,
output
wire
out
);
reg
[
2
:
0
]
state
,
next_state
;
// Sequential block: state transitions on clock or reset
always
@(
posedge
clk
or
posedge
reset
)
begin
if
(
reset
)
state
<=
3
'b000
;
// Reset state
else
state
<=
next_state
;
end
// Combinational block: next state logic
always
@(
*
)
begin
case
(
state
)
3
'b000
:
next_state
=
in1
?
3
'b001
:
3
'b010
;
3
'b001
:
next_state
=
in2
?
3
'b011
:
3
'b100
;
3
'b010
:
next_state
=
3
'b101
;
3
'b011
:
next_state
=
3
'b000
;
// Loop back to initial state
3
'b100
:
next_state
=
3
'b000
;
// Another loop to initial state
3
'b101
:
next_state
=
3
'b000
;
// Terminal state back to initial
default
:
next_state
=
3
'b000
;
// Safe default for illegal states
endcase
end
// Combinational block: output logic
assign
out
=
(
state
==
3
'b101
);
// Output '1' only in state 101
endmodule
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 4:35 AM (13 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
307619
Default Alt Text
branchingmux_binary_7.v (1 KB)
Attached To
Mode
R231 SoC_I-Edge_yosys_nem_optimization
Attached
Detach File
Event Timeline
Log In to Comment