You are on page 1of 3

SISTEM DIGITAL LANJUT

Laporan ini disusun untuk memenuhi tugas Sistem Digital Lanjut


LECTURE 3 - ASSIGNMENT 2

DISUSUN OLEH :
GALIH BAYU PRAKOSO (21120120120023)
TEKNIK KOMPUTER S1

FAKULTAS TEKNIK
UNIVERSITAS DIPONEGORO
NIM: 21120120120023
X=2 Y=3 ⭢ Rangkaian 3 Input OR pendekatan behavioral.
Source code gerbang OR:
// Galih Bayu Prakoso
// 21120120120023
// Source code design OR gate 3 input behavioral

module OR_behavioral (output reg Y, input A, B, C);


always @ (A or B or C) begin
if (A == 1'b0 & B == 1'b0 & C == 1'b0)
begin Y = 1'b0;
end
else
Y = 1'b1;
end
endmodule

Source code test-bench:


// Galih Bayu Prakoso
// 21120120120023
// Source code testbench OR gate 3 input behavioral

module
OR_behavioral_tb; reg
A, B, C;
wire Y;
OR_behavioral Indtance0 (Y, A, B, C);

initial begin
$dumpfile("dump.vcd");
$dumpvars(1, OR_behavioral_tb);
$monitor ("%t | A = %d| B = %d| C = %d| Y = %d", $time, A, B, C, Y);

A = 0; B = 0; C = 0;
#1 A = 0; B = 0; C = 1;
#1 A = 0; B = 1; C = 1;
#1 A = 1; B = 0; C = 0;
#1 A = 1; B = 0; C = 1;
#1 A = 1; B = 1; C = 0;
#1 A = 1; B = 1; C = 1;
#1;

end
endmodule

Capture/printscreen layar utama:

Gambar 1 Layar Utama


Capture/printscreen EP waveform:

Gambar 2 waveform

You might also like