Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20677 Discussions

How to provide logic inputs?

Altera_Forum
Honored Contributor II
1,004 Views

Hi 

 

I am new to Altera 13.1. I have written a OR gate VHDL code and it compiled successfully. I know how to view the waveform using Modelsim Altera. What I want to know is how to provide logic states like 0 and 1 to the inputs of OR gate. I need to see the o/p of 1 input OR gate for all the 4 possible values in the wave window.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
302 Views

You can use push button or DIP switch as input and user LED as a output.This is the simplest way to test your OR gate design.

0 Kudos
Altera_Forum
Honored Contributor II
302 Views

But zoomkrupesh, that requires hardware. The OP asked for modelsim. 

 

Jayanth - you need to create a testbench for your OR gate. This will be written in VHDL. But you can use non-synthesisable constructs in the coding, as you will only simulate it: 

 

signal a,b,c : std_logic; a <= '0', '1' after 10 ns, '0' after 20 ns; b <= '0', '1' after 20 ns; or_inst : entity work.my_or_gate port map ( a <= a; b <= b; op <= op );
0 Kudos
Altera_Forum
Honored Contributor II
302 Views

Thank you very much Tricky. I will try that and let you know the result.

0 Kudos
Altera_Forum
Honored Contributor II
302 Views

Sorry Janyanth, 

 

I didn't understand your question. Whatever tricky has suggested is correct.  

You can also use clocks as a input of the OR gate. You can use two clocks in such a manner that frequency of one clock is double then second clock. By doing this you can test all the four possibilities.
0 Kudos
Reply