added v2.0

This commit is contained in:
Michael Schröder
2023-01-11 11:13:09 +01:00
parent 2a5a64ca91
commit 971b323822
584 changed files with 159319 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
`include "../../01_Boolean_Logic/Nand.v"
`include "../../01_Boolean_Logic/Not.v"
`include "../../01_Boolean_Logic/Buffer.v"
`include "../../01_Boolean_Logic/And.v"
`include "../../01_Boolean_Logic/Or.v"
`include "../../01_Boolean_Logic/Xor.v"

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View File

@@ -0,0 +1,35 @@
[*]
[*] GTKWave Analyzer v3.3.104 (w)1999-2020 BSI
[*] Thu Dec 22 14:50:07 2022
[*]
[dumpfile] "/home/micha/gitlab/nand2tetris/01_Boolean_Logic/05_Xor/Xor_tb.vcd"
[dumpfile_mtime] "Thu Dec 22 14:49:53 2022"
[dumpfile_size] 987
[savefile] "/home/micha/gitlab/nand2tetris/01_Boolean_Logic/05_Xor/Xor_tb.gtkw"
[timestart] 0
[size] 1332 600
[pos] -1 -1
*-0.771027 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 281
[signals_width] 100
[sst_expanded] 1
[sst_vpaned_height] 132
@200
-IN
@28
Xor_tb.a
Xor_tb.b
@200
-OUT
@28
Xor_tb.out
@200
-CMP
@29
Xor_tb.out_cmp
@200
-Test
@28
Xor_tb.fail
[pattern_trace] 1
[pattern_trace] 0

View File

@@ -0,0 +1,47 @@
`default_nettype none
module Xor_tb();
// IN,OUT
reg a,b;
wire out;
// Part
Xor XOR(
.a(a),
.b(b),
.out(out)
);
// Compare
wire out_cmp;
assign out_cmp = a^b;
reg fail = 0;
task check;
#1
if (out != out_cmp)
begin
$display("FAIL: a=%1b, b=%1b, out=%1b",a,b,out);
fail = 1;
end
endtask
// Test
initial begin
$dumpfile("Xor_tb.vcd");
$dumpvars(0, Xor_tb);
$display("------------------------");
$display("Testbench: Xor");
a=0;b=0;check();
a=0;b=1;check();
a=1;b=0;check();
a=1;b=1;check();
if (fail==0) $display("passed");
$display("------------------------");
$finish;
end
endmodule

View File

@@ -0,0 +1,3 @@
[env]
board = iCE40-HX1K-EVB

View File

@@ -0,0 +1,10 @@
# physical constrain file
# assign io-pins to pin numbering of iCE40-HX1K on olimex board iCE40-HX1K-EVB
# compare to the schematic of the board and the datasheet of fpga
set_io BUT1 41 # BUT1
set_io BUT2 42 # BUT2
set_io LED1 40 # LED1
set_io LED2 51 # LED2

View File

@@ -0,0 +1,11 @@
`default_nettype none
module top(
input BUT1,
input BUT2,
output LED1,
output LED2
);
Xor XOR(.a(BUT1),.b(BUT2),.out(LED1));
endmodule