Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > synchronous register

Reply
Thread Tools

synchronous register

 
 
ejann ejann is offline
Junior Member
Join Date: Feb 2009
Posts: 2
 
      02-10-2009
Hi,

Can someone show me how to;

1. create a synchronous register set and reset signals that will output a toogle value for every clock pulse.

2. create a counter with asynchronous reset and a load enable signals.This load enable will determine any number within the range to be entered into the counter whereas the reset signal will reset the counter to the value of the number loaded.

I'm using Altera Quartus II 8.1.

Thanks.
 
Reply With Quote
 
 
 
 
eliascm eliascm is offline
Member
Join Date: Jan 2009
Posts: 42
 
      02-10-2009
I am quite sure someone can show you how to do the two things you ask. I doubt if anyone will show you. This appears to be a student problem that you want someone else to solve for you. Niether one of the problems is difficult, so why don't you try to solve them yourself? There are many textbook illustrations of modules similar to what you want. Have you looked for any of them? If you try to solve them and don't quite do so, then show us what you tried and someone will point you in the right direction. I have never understood how a student expects to learn by being spoon fed answers that he/she is too lazy to even try to work out for himself/herself.
 
Reply With Quote
 
 
 
 
ejann ejann is offline
Junior Member
Join Date: Feb 2009
Posts: 2
 
      02-11-2009
for Q1.

library ieee;
use ieee.std_logic_1164.all;

entity shift is
port(C, SI : in std_logic;
SO : out std_logic);
end shift;
architecture beh of shift is
signal tmp: std_logic_vector(7 downto 0);
begin
process (C)
begin
if (C'event and C='1') then
for i in 0 to 6 loop
tmp(i+1) <= tmp(i);
end loop;
tmp(0) <= SI;
end if;
end process;
SO <= tmp(7);
end beh;

for Q2.

library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;

entity count2 is
port(clk,r,le : in std_logic;
d : in integer;
q : out integer);

end count2;

architecture beh of count2 is
begin
process(clk,r,le)
variable var_cnt : integer range 0 to 256;

begin
case(r) is
when '1' =>
var_cnt :=0;
when '0' =>
if le ='1' then
var_cnt :=d;
elsif (clk'event and clk ='1') then
var_cnt := var_cnt +1;
end if;
when others =>
var_cnt := 0;
end case;

q<=var_cnt;

end process;
end beh;

someone can verify that for me..
 
Reply With Quote
 
eliascm eliascm is offline
Member
Join Date: Jan 2009
Posts: 42
 
      02-11-2009
You should now make a test bench to simulate your code. That is the best way to ascertain that your design is functionally correct (it will also flag any syntax errors).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between synchronous (proactor pattern) and synchronous model in web server Rickert C++ 0 10-06-2011 04:54 AM
Can a function be synchronous? cruzin VHDL 2 11-21-2003 07:46 PM
Are clock and divided clock synchronous? Valentin Tihomirov VHDL 11 10-28-2003 01:18 PM
bad synchronous Pedro Claro VHDL 1 08-18-2003 04:48 PM
Synchronous processes and delays Thomas VHDL 2 07-06-2003 10:24 PM



Advertisments