Solve Simple VHDL Problem: Get 20/20 on Exam

  • Thread starter Thread starter Shahil
  • Start date Start date
Click For Summary
SUMMARY

The forum discussion centers on a VHDL exam question where the user struggled to implement a bus entity and its architecture. The user attempted to define an entity named "Bus" with input ports for write signals and data, but faced issues with the output variable "f". Additionally, the user expressed confusion regarding the declaration of control signals in the entity for a second question, highlighting a lack of understanding of VHDL programming concepts. The discussion emphasizes the importance of mastering VHDL basics to achieve full marks in examinations.

PREREQUISITES
  • Understanding of VHDL syntax and structure
  • Familiarity with entity and architecture concepts in VHDL
  • Knowledge of bit_vector and std_logic data types in VHDL
  • Basic concepts of digital design and control signals
NEXT STEPS
  • Study VHDL entity and architecture definitions in detail
  • Learn about signal assignments and conditional statements in VHDL
  • Explore the use of control signals in VHDL designs
  • Practice VHDL programming with example problems and solutions
USEFUL FOR

Students preparing for VHDL examinations, educators teaching digital design, and anyone looking to improve their VHDL programming skills.

Shahil
Messages
116
Reaction score
21

Homework Statement



Hey there ... I got this VHDL problem as an exam question and it kinda freaked me out .. had no idea where to even begin and hence, got like 2 marks out of 20.

I do want to know how to program these though:

Here are the questions:

q31.jpg

q32.jpg

Homework Equations



Well, it's VHDL .. use what you like I guess .. but keep it simple as possible.

The Attempt at a Solution



My attempt at Q1 (which I think is wrong)

Entity Bus is
Begin
port(write1, write2, write3: in std_logic;
wdata1, wdata2, wdata3: in bit_vector(7 downto 0);
f: out bit_vector(7 downto 0));
-- The f variable is what I think is wrong.
End Bus;

Architecture Behaviour of Bus is
Begin
f <= wdata1 when write1 = "1" else
wdata2 when write2 = "1" else
wdata3 when write3 = "1";
End Behaviour;

--

For Q2 .. I was VERY unsure ... What I did was treat the entire structure as the Entity with the inputs:
io_port_data, address_rf, write_rf
I'm not sure if the control signals (load_accumulator, bus_rf, bus_alu, bus_ioport) are to be declared in the Entity.

What confused me is that this Bus has output ports, unlike the Entity described above. Also, I don't know how to program the the registers. This question made up 20 percent of the exam .. If I did get 20/20 .. I would have passed :( PLEASE help!
 
Physics news on Phys.org
I just started to really learn VHDL, but it seems like there's a lot wrong with this...
 

Similar threads

Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
12K
Replies
4
Views
5K
Replies
1
Views
9K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
12K
  • · Replies 3 ·
Replies
3
Views
3K