2) Memahami cara kerja VGA pada umumnya. Pada percobaan kali ini kita menggunakan resolusi
640x480 pixel dan menggunakan refresh rate lebih
2. STUDI PUSTAKA dari 60 Hz. Refresh rate ini digunakan karena pada
range kurang dari 30 ‐ 60 Hz manusia dapat
2.1 VIDEO GRAPHICS ARRAY (VGA) melihat adanya flicker. Selain itu refresh rate ini
juga umum digunakan pada monitor LCD. LCD
Video Graphics Array (VGA) masih menjadi modern memiliki fitur multirate, sehingga kita
interface yang popular untuk sebuah tampilan. tidak harus tepat membuat refresh ratenya 60 Hz.
VGA interface ini masih banyak ditemukan di Proses scanning berawal dari kiri atas ke kanan
beberapa device sekarang, misalnya layar LCD dan lalu ke kiri bawah dan kembali ke kiri atas ketika
proyektor. VGA interface ini terdapat juga di board sudah mencapai pixel terakhir.
altera yang kita gunakan saat ini. Pada percobaan
kali ini tampilan VGA digunakan agar tampilan
hasil desain yang kita rancang menjadi lebih
menarik, tidak terbatas hanya pada LED atau 7‐
Segment. Tujuan percobaan kali ini juga adalah
memberikan ilustrasi penggunaan interface I/O
yang ada pada FPGA, misalnya GPIO, komunikasi
serial menggunakan RS232, Audio CODEC, LCD
karakter 16x2, dll.[1] Gambar 2-1 Razor Scan pada Layar LCD[1]
Buatlah project baru dengan modul‐modul yang Buatlah project baru dengan modul‐modul yang disediakan
disediakan untuk praktikum pada file display_DE1 untuk praktikum pada file display_DE1 yang sudah
yang sudah didownload dari labdasar. didownload dari labdasar dan terdapat pada lampiran 2.
Atur pin I/O dengan mengimport pin assignment Implementasikan desain FSM tersebut dengan keluaran pada
dari file top_level_qsf yang disediakan oleh layar dengan langkah-langkah seperti pada percobaan 4B.
lebdasar.
5. KESIMPULAN
1. Video Graphics Array (VGA) memiliki interface
untuk menampilkan output dalam bentuk
video di layar. VGA terdapat pada board FPGA
altera. VGA dapat diimplementasikan dengan
program VHDL serta melalui FPGA.
2. Melalui VGA, output akan ditampilkan sebagai
warna pada piksel di layar. Untuk
menampilkan output, VGA bekerja dengan
melakukan pembacaan (scanning) dari piksel
yang terletak pada ujung kiri atas layar, ke
kanan hingga menuju piksel pada ujung kanan
atas layar, setelahnya berganti ke ujung kiri
baris selanjutnya, terus hingga piksel terakhir
yang terdapat pada ujung kanan bawah layar.
Output pada layar dapat digeser dengan
melakukan operasi pengurangan dan
penambahan piksel secara horizontal untuk
pergeseran ke kiri-kanan ataupun secara
BEGIN
Laporan Praktikum - Laboratorium Dasar Teknik Elektro – STEI ITB 13
'0';
vga_driver0 : vga c0 : OUT STD_LOGIC ;
locked : OUT STD_LOGIC
PORT MAP ( );
i_clk => i_clk, END pll_vhd;
i_red => '1',
i_green => '1',
i_blue => '1', ARCHITECTURE SYN OF pll_vhd IS
o_red => red_on, SIGNAL sub_wire0 : STD_LOGIC_VECTOR
o_green => green_on, (5 DOWNTO 0);
o_blue => blue_on, SIGNAL sub_wire1 : STD_LOGIC ;
o_horiz_sync => VGA_HS, SIGNAL sub_wire2 : STD_LOGIC ;
o_vert_sync => VGA_VS, SIGNAL sub_wire3 : STD_LOGIC ;
SIGNAL sub_wire4 : STD_LOGIC_VECTOR
o_pixel_row => pixel_row, (1 DOWNTO 0);
o_pixel_column => pixel_column); SIGNAL sub_wire5_bv : BIT_VECTOR (0
DOWNTO 0);
color_rom0 : color_rom_vhd SIGNAL sub_wire5 : STD_LOGIC_VECTOR
PORT MAP ( (0 DOWNTO 0);
i_M_US => i_M_US,
i_K_US => i_K_US,
i_H_US => i_H_US, COMPONENT altpll
i_M_BT => i_M_BT, GENERIC (
i_K_BT => i_K_BT, clk0_divide_by : NATURAL;
clk0_duty_cycle : NATURAL;
i_H_BT => i_H_BT, clk0_multiply_by : NATURAL;
i_pixel_column => pixel_column, clk0_phase_shift : STRING;
i_pixel_row => pixel_row, compensate_clock : STRING;
o_red => red_color, gate_lock_signal : STRING;
o_green => green_color, inclk0_input_frequency : NATURAL;
intended_device_family : STRING;
o_blue => blue_color); invalid_lock_multiplier : NATURAL;
lpm_hint : STRING;
red <= red_color (7 DOWNTO 2) ; lpm_type : STRING;
green <= green_color(7 DOWNTO 2) ; operation_mode : STRING;
blue <= blue_color (7 DOWNTO 2) ; port_activeclock : STRING;
port_areset : STRING;
port_clkbad0 : STRING;
port_clkbad1 : STRING;
PROCESS(red_on,green_on,blue_on,red,green, port_clkloss : STRING;
blue) port_clkswitch : STRING;
BEGIN port_configupdate : STRING;
port_fbin : STRING;
port_inclk0 : STRING;
IF (red_on = '1' ) THEN VGA_R <= red; port_inclk1 : STRING;
ELSE VGA_R <= "000000"; port_locked : STRING;
END IF; port_pfdena : STRING;
port_phasecounterselect : STRING;
port_phasedone : STRING;
IF (green_on = '1' ) THEN VGA_G <= port_phasestep : STRING;
green; port_phaseupdown : STRING;
ELSE VGA_G <= "000000"; port_pllena : STRING;
END IF; port_scanaclr : STRING;
port_scanclk : STRING;
port_scanclkena : STRING;
IF (blue_on = '1' ) THEN VGA_B <= port_scandata : STRING;
blue; port_scandataout :
ELSE VGA_B <= "000000"; STRING;
END IF; port_scandone : STRING;
port_scanread : STRING;
port_scanwrite : STRING;
port_clk0 : STRING;
END PROCESS; port_clk1 : STRING;
port_clk2 : STRING;
port_clk3 : STRING;
port_clk4 : STRING;
port_clk5 : STRING;
END behavioral; port_clkena0 : STRING;
port_clkena1 : STRING;
port_clkena2 : STRING;
port_clkena3 : STRING;
pll_vhd.vhd (semua percobaan) port_clkena4 : STRING;
port_clkena5 : STRING;
LIBRARY ieee; port_extclk0 : STRING;
USE ieee.std_logic_1164.all; port_extclk1 : STRING;
port_extclk2 : STRING;
LIBRARY altera_mf; port_extclk3 : STRING;
USE altera_mf.all; valid_lock_multiplier :
NATURAL
ENTITY pll_vhd IS );
PORT PORT (
( inclk : IN
inclk0 : IN STD_LOGIC := STD_LOGIC_VECTOR (1 DOWNTO 0);
BEGIN
sub_wire5_bv(0 DOWNTO 0) <= "0";
sub_wire5 <=
To_stdlogicvector(sub_wire5_bv);
sub_wire1 <= sub_wire0(0);
c0 <= sub_wire1;
locked <= sub_wire2;
sub_wire3 <= inclk0;
sub_wire4 <= sub_wire5(0 DOWNTO 0) &
sub_wire3;
altpll_component : altpll
GENERIC MAP (
clk0_divide_by => 2,
clk0_duty_cycle => 50,
clk0_multiply_by => 1,
clk0_phase_shift => "0",
compensate_clock => "CLK0",
gate_lock_signal => "NO",
inclk0_input_frequency => 20000,
intended_device_family => "Cyclone
II",
invalid_lock_multiplier => 5,
lpm_hint =>
"CBX_MODULE_PREFIX=pll_vhd",
lpm_type => "altpll",
operation_mode => "NORMAL",
port_activeclock => "PORT_UNUSED",
port_areset => "PORT_UNUSED",
port_clkbad0 => "PORT_UNUSED",
port_clkbad1 => "PORT_UNUSED",
port_clkloss => "PORT_UNUSED",
port_clkswitch => "PORT_UNUSED",
port_configupdate =>
"PORT_UNUSED",
port_fbin => "PORT_UNUSED",
port_inclk0 => "PORT_USED",
port_inclk1 => "PORT_UNUSED",
port_locked => "PORT_USED",
port_pfdena => "PORT_UNUSED",
port_phasecounterselect =>
"PORT_UNUSED",
port_phasedone => "PORT_UNUSED",
port_phasestep => "PORT_UNUSED",
port_phaseupdown => "PORT_UNUSED",
port_pllena => "PORT_UNUSED",
port_scanaclr => "PORT_UNUSED",
port_scanclk => "PORT_UNUSED",
port_scanclkena => "PORT_UNUSED",
port_scandata => "PORT_UNUSED",
port_scandataout => "PORT_UNUSED",
port_scandone => "PORT_UNUSED",
port_scanread => "PORT_UNUSED",
port_scanwrite => "PORT_UNUSED",
port_clk0 => "PORT_USED",
port_clk1 => "PORT_UNUSED",
port_clk2 => "PORT_UNUSED",
port_clk3 => "PORT_UNUSED",
port_clk4 => "PORT_UNUSED",
port_clk5 => "PORT_UNUSED",
port_clkena0 => "PORT_UNUSED",
port_clkena1 => "PORT_UNUSED",
port_clkena2 => "PORT_UNUSED",
port_clkena3 => "PORT_UNUSED",
port_clkena4 => "PORT_UNUSED",
port_clkena5 => "PORT_UNUSED",
port_extclk0 => "PORT_UNUSED",
port_extclk1 => "PORT_UNUSED",
port_extclk2 => "PORT_UNUSED",
port_extclk3 => "PORT_UNUSED",
valid_lock_multiplier => 1
)
PORT MAP (
inclk => sub_wire4,
clk => sub_wire0,
locked => sub_wire2
);
END SYN;