Program parallel port sebagai gerbang logika
-
Upload
arri-adhy -
Category
Technology
-
view
167 -
download
1
Transcript of Program parallel port sebagai gerbang logika
http://intelegenci.blogspot.com
PROGRAM PARALLEL PORT SEBAGAI GERBANG LOGIKA
Gambar program AND gate Gambar program NOT gate
TENTANG PROGRAM :
Ada empat buah komponen penting pada program AND gate berbeda halnya dengan komponen
NOT gate yang hanya mempunyai satu textBox, hal ini dikarenakan gerbang or hanya memiliki satu
inputan yang akan dimasukkan dalam textbox.
1. Tombol kirim.
2. Tombol Clear.
3. textBox
Penjelasan :
1. Tombol kirim berfungsi untuk menghidupkan LED pada rangkaian elektronika yang terhubung ke
port parallel sesuai dengan bit yang ada pada logika yang sudah diisi pada Tombol kirim.
2. Fungsi textbox berguna untuk memasukan inputan anka biner 1/0 layaknya gerbang logika yang
diberi aktiv tinggi dan aktiv rendah.
3. Fungsi tombol Clear bila ditekan akan mengubah LED pada rangkaian menjadi mati.
http://intelegenci.blogspot.com
ALGORITMA PROGRAM :
ALGORITMA PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG AND
T
Y
Mulai
Data = “255”
Clear = “0”
Output = data
“LED HIDUP”
Selesai
Output = Clear
“LED MATI”
textBox1 = “1”
textBox2 =“1”
http://intelegenci.blogspot.com
Data = “255”
Clear = “0”
textBox1 = “1”
textBox2 =“1”
Output = Clear
“LED MATI”
Output = data
“LED HIDUP”
Selesai
textBox1 = “0”
textBox2 =“0”
ALGORITMA PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG NOR
T T
Y Y
Mulai
http://intelegenci.blogspot.com
textBox1 = “0”
textBox2 =“0”
Output = Data
“LED HIDUP”
Output = Clear
“LED MATI”
Selesai
ALGORITMA PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG OR
T
Y
Mulai
Data = “255”
Clear = “0”
http://intelegenci.blogspot.com
textBox1 = “0”
Output = CLEAR
“LED MATI”
Output = Data
“LED HIDUP”
Selesai
ALGORITMA PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG NOT
T
Y
Mulai
Data = “255”
Clear = “0”
http://intelegenci.blogspot.com
Output = CLEAR
“LED MATI”
Output = Data
“LED HIDUP”
Selesai
textBox1 = “0”
textBox2 =“1”
textBox1 = “1”
textBox2 =“0”
ALGORITMA PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG XOR
T T
Y Y
Mulai
Data = “255”
Clear = “0”
http://intelegenci.blogspot.com
SOURCE CODE PROGRAM :
SOURCE CODE PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG AND
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { const string data = "255"; const string clear = "0"; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "1") if (textBox2.Text == "1") { LPT.Output(0x378, Int32.Parse(data)); } else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } } private void button2_Click(object sender, EventArgs e) { LPT.Output(0x378, Int32.Parse(clear)); } private void Form1_Load(object sender, EventArgs e) { } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); }
http://intelegenci.blogspot.com
} }
SOURCE CODE PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG NOR
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { const string data = "255"; const string clear = "0"; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "1") if (textBox2.Text == "1") { LPT.Output(0x378, Int32.Parse(data)); } else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } if (textBox1.Text == "0") if (textBox2.Text == "0") { LPT.Output(0x378, Int32.Parse(data)); } else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } } private void button2_Click(object sender, EventArgs e) { LPT.Output(0x378, Int32.Parse(clear)); }
http://intelegenci.blogspot.com
private void Form1_Load(object sender, EventArgs e) { } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); } } }
SOURCE CODE PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG OR
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { const string data = "255"; const string clear = "0"; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "0" & textBox2.Text == "0") { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } else { LPT.Output(0x378, Int32.Parse(data)); }
http://intelegenci.blogspot.com
} private void button2_Click(object sender, EventArgs e) { LPT.Output(0x378, Int32.Parse(clear)); } private void Form1_Load(object sender, EventArgs e) { } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); } } }
SOURCE CODE PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG NOT
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { const string data = "255"; const string clear = "0"; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "0") { LPT.Output(0x378, Int32.Parse(data));
http://intelegenci.blogspot.com
} else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } } private void Form1_Load(object sender, EventArgs e) { } private void button2_Click(object sender, EventArgs e) { LPT.Output(0x378, Int32.Parse(clear)); } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); } } }
SOURCE CODE PEMROGRAMAN PARALLEL PORT SEBAGAI GERBANG XOR
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication1 { public partial class Form1 : Form { const string data = "255"; const string clear = "0"; public Form1() { InitializeComponent();
http://intelegenci.blogspot.com
} private void button1_Click(object sender, EventArgs e) { if (textBox1.Text == "1") if (textBox2.Text == "0") { LPT.Output(0x378, Int32.Parse(data)); } else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } if (textBox1.Text == "0") if (textBox2.Text == "1") { LPT.Output(0x378, Int32.Parse(data)); } else { LPT.Output(0x378, Int32.Parse(clear)); MessageBox.Show("Led Mati"); } } private void button2_Click(object sender, EventArgs e) { LPT.Output(0x378, Int32.Parse(clear)); } private void Form1_Load(object sender, EventArgs e) { } private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { System.Diagnostics.Process.Start("http://intelegenci.blogspot.com"); } } }