Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
ESERCITAZIONE 2022-01-12
ESERCITAZIONE 2022-01-12
[3] Y = X + 1, 0 ≤ Y ≤ 4
dalla [3].
[3] Y = X + 1, 0 ≤ Y ≤ 4
fi
ESERCITAZIONE 2022-01-12
dalla [3].
[3] Y = X + 1, 0 ≤ Y ≤ 4 Y0 = X1 X0 + X1X0 = X0
Y1 = X1 X0 + X1X0 = X1 ⊕ X0
Y2 = X1X0
fi
ESERCITAZIONE 2022-01-12
X1
Y0 = X1 X0 + X1X0 = X0 Y1
Y1 = X1 X0 + X1X0 = X1 ⊕ X0
Y2 = X1X0 Y2
fi
ESERCITAZIONE 2022-01-12
Y0 = X1 X0 + X1X0 = X0 Y1
Y1 = X1 X0 + X1X0 = X1 ⊕ X0
Y2 = X1X0 Y2
fi
ESERCITAZIONE 2022-01-12
/* studentid: 0987645
* 0987645 4=4'b0100
▸ Implementazione in SystemVerilog * ^ ^^
* n
(non richiesta) *
* n=2'b00 k=max(2'b00, 1)=1
* y=x+2'b01
▸ Modulo */
/*
assign y[0]=~x[0];
assign y[1]= x[1]^x[0];
assign y[2]= x[1]&x[0];
*/
assign y=x+2'b01;
endmodule
ESERCITAZIONE 2022-01-12
module q17_tb();
Q17. HDL RETE COMBINATORIA logic [1:0] x;
logic [2:0] y;
logic [2:0] counter;
ESERCITAZIONE 2022-01-12
ESERCITAZIONE 2022-01-12
0 S2
1 1
0 1
1 S1
1 0
0 S3
1 0
S0
reset
1
ESERCITAZIONE 2022-01-12
0 S2
1 Current
1 Output: Y
0 1 State: S
1 S1
1 0 S0 1
0 S3
1 0 S1 1
S0 S2 1
reset
1 S3 0
State S1S0
S0 00
S1 01 Current Input: Next State:
State: S1S0 X S’1S’0
S2 10
S3 11 00 0 01
Tabella di codi ca degli stati
00 1 00
Current
S′1 = S1S0 X + S1S0 X 01
01
0
1
01
10
Output: Y
State: S1S0 S′0 = S1S0 + X 10 0 01
00 1
01 1 Y = S1 + S0 10
11
1
0
11
01
10 1 11 1 00
11 0


Tabella di uscita (codi cata) Tabella di transizione (codi cata)
fi
fi
fi
ESERCITAZIONE 2022-01-12
S10 S1
CLK
X
S00 S0
rst
endmodule
ESERCITAZIONE 2022-01-12
`timescale 1ns/1ns
Q19. HDL RETE SEQUENZIALE
module q19_tb();
logic clk, reset, x, y;
ESERCITAZIONE 2022-01-12
ESERCITAZIONE 2022-01-12