first commit

This commit is contained in:
Jose Luis Montañes Ojados
2026-02-28 21:59:55 +01:00
commit d094ff3148
21 changed files with 2286 additions and 0 deletions

34
mux_demux/mux_demux.v Normal file
View File

@@ -0,0 +1,34 @@
/*
Mux / Demux
Mux
a b sel | out
-------------------
0 0 0 | 0
1 0 0 | 1
0 1 1 | 1
1 0 1 | 0
...
*/
module mux_2n1 #(parameter N = 8) (
input [N-1:0] a,
input [N-1:0] b,
input sel,
output [N-1:0] out
);
assign out = sel ? b : a;
endmodule
module demux_1n2 #(parameter N = 8) (
input [N-1:0] in,
input sel,
output [N-1:0] a,
output [N-1:0] b
);
assign a = sel ? 0 : in;
assign b = sel ? in : 0;
endmodule