How to Connect VHDL Counter Output to a Binary Decoder?

Click For Summary
SUMMARY

The discussion focuses on connecting the output of a 5-bit VHDL counter to a binary decoder. The provided VHDL code defines a counter with a synchronous load signal, allowing it to be preset to a specific initial state. To connect the counter output to the binary decoder, participants suggest defining the decoder outputs and directly assigning each bit of the counter to the decoder outputs without requiring a process. An alternative approach is to define the counter output as an array instead of a signal.

PREREQUISITES
  • Understanding of VHDL syntax and structure
  • Familiarity with binary counters and their operation
  • Knowledge of binary decoders and their functionality
  • Experience with synchronous logic design
NEXT STEPS
  • Explore VHDL signal vs. variable assignments
  • Learn about binary decoder implementation in VHDL
  • Investigate synchronous vs. asynchronous loading in counters
  • Study VHDL behavioral modeling techniques
USEFUL FOR

VHDL developers, digital design engineers, and students working on hardware description languages and synchronous circuit design.

tetooo_2006
Messages
1
Reaction score
0

Homework Statement



structure or behavior VHDL code of a 5-bits binary counter with a sync. load signal to preset the counter to a specific initial state. the output of the counter (Q0 to Q4) are connected to a binary decoder that shows the state of the counter.

Homework Equations


The Attempt at a Solution


I wrote the code of 5 bits counter
Code:
LIBRARY ieee;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
ENTITY counter IS
PORT ( count : OUT unsigned (4 DOWNTO 0);
load : IN STD_LOGIC;
pre :IN unsigned (4 DOWNTO 0);
Clk : IN STD_LOGIC);
END counter;
ARCHITECTURE Behavioral OF counter IS
SIGNAL c : unsigned(4 DOWNTO 0) := "00000";

BEGIN
count <= c;
PROCESS(Clk)
BEGIN
IF( rising_edge(Clk) ) THEN
IF(load = '1') THEN
c <= pre;
ELSE
c <= c + 1;
END IF;
END IF;
END PROCESS;
END Behavioral;

I want to connect the output to a binary decoder that shows the state of the counter
how can i do that?
 
Last edited by a moderator:
Physics news on Phys.org
You can just define the decoder outputs and then assign each bit of c to an output. It doesn't have to be a process. Alternatively, you can just define c as an output (array) instead of a signal.
 

Similar threads

Replies
1
Views
9K
  • · Replies 2 ·
Replies
2
Views
12K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
7K
Replies
10
Views
5K
  • · Replies 1 ·
Replies
1
Views
28K
  • · Replies 1 ·
Replies
1
Views
23K
  • · Replies 3 ·
Replies
3
Views
3K