0% found this document useful (0 votes)
124 views8 pages

This Study Resource Was: Modelsim Pe Student Edition Is A Free Download of The Industry-Leading

This document discusses simulating concurrent processes in VHDL using ModelSim. It provides instructions on installing ModelSim, writing VHDL code with concurrent statements, and simulating the code. The code example increments an unsigned signal using three different concurrent process techniques: a normal process with wait, a process sensitive to the signal, and a pure concurrent statement. Running the simulation shows the signals updating every 10 nanoseconds.

Uploaded by

다나
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
124 views8 pages

This Study Resource Was: Modelsim Pe Student Edition Is A Free Download of The Industry-Leading

This document discusses simulating concurrent processes in VHDL using ModelSim. It provides instructions on installing ModelSim, writing VHDL code with concurrent statements, and simulating the code. The code example increments an unsigned signal using three different concurrent process techniques: a normal process with wait, a process sensitive to the signal, and a pure concurrent statement. Running the simulation shows the signals updating every 10 nanoseconds.

Uploaded by

다나
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Concurrent Process

Course Code: NCP 3201 Program:


Course Title: Introduction to HDL Date Performed: May 05, 2021
Section: Date Submitted: May 05, 2021
Leader: 1. Alpuerto, Danica Mae V. Instructor: Prof. Onofre Corpuz
Members:
1. Objective(s):
The activity aims to demonstrate the procedures on how to simulate the
concurrent process statement in Model Sim.
2. Intended Learning Outcomes (ILOs):
The students shall be able to:
2.1 Test the step by step procedure in running the use of
concurrent process statement VHDL codes to Model Sim.
3. Discussion:

m
er as
ModelSim PE Student Edition is a free download of the industry-leading
ModelSim HDL simulator for use by students in their academic coursework

co
eH w
(www.mentor.com).

o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th

Figure 3.1. Model Sim Environment

This application can be downloaded through the website but the license
sh

must request individually through sending it to your email.


A concurrent statement in VHDL is a signal assignment within the
architecture, but outside of a normal process construct. The concurrent
statement is also referred to as a concurrent assignment or concurrent
process. When you create a concurrent statement, you are creating a
process with certain, clearly defined characteristics.

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
Review of signed and unsigned:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;

entity signedunsigned12 is
end entity;

architecture sim of signedunsigned12 is


signal unscnt : unsigned(7 downto 0) := (others =>'0');
signal sigcnt : signed(7 downto 0) := (others =>'0');

signal uns4 : unsigned(3 downto 0) := "1000";


signal sig4 : signed(3 downto 0) := "1000";

m
er as
signal uns8 : unsigned(7 downto 0) := (others =>'0');

co
signal sig8 : signed(7 downto 0) := (others =>'0');

eH w
begin

o.
process is
begin rs e
ou urc
wait for 10 ns;
--wrapping counter
unscnt <= unscnt +1;
o

sigcnt <= sigcnt +1;


aC s

--adding signals
vi y re

uns8 <= uns8 + uns4;


sig8 <= sig8 + sig4;
end process;
ed d

end architecture;
ar stu
is
Th
sh

0 8 16 32 ……. Signed identify 1 as negative while unsigned normally


adding numbers. Then 1000 equals 8 in decimal.

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
4. Resources:
Computer System with internet access

m
Model Sim Installer capacity is 345MB while it needs 400MB space

er as
memory to your OS drive

co
eH w
5. Procedure:

o.
1. Install notepad++, must add the VHDL .dll plugins
rs e
2. Open the notepad++, create new file
ou urc
Copy the following codes:
library ieee;
use ieee.std_logic_1164.all;
o

use ieee.numeric_std.all;
aC s
vi y re

entity T13_ConcurrentProcsTb is
end entity;

architecture sim of T13_ConcurrentProcsTb is


ed d

signal Uns : unsigned(5 downto 0) := (others => '0'); --Uns is


ar stu

unsigned variable which was initialized to zero


--The statement "Others => '0'" is a feature of the VHDL when the coder
want to defined several items in an array with the same value.
is

signal Mul1 : unsigned(7 downto 0);


signal Mul2 : unsigned(7 downto 0);
Th

signal Mul3 : unsigned(7 downto 0);


begin
process is
sh

begin
Uns <= Uns + 1; --increment by 1 every 10 ns

wait for 10 ns;

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
end process;
--Process multiplying Uns by 4
process is

begin
Mul1 <= Uns & "00"; --the Uns 6 bits was added two zeros to
have 8 bits

wait on Uns; --the program will wait here until the 6-bit signal
changes
--when this happens it will wake up

end process;
--Equivalent process using sensitivity list
process(Uns) is

m
er as
begin

co
eH w
Mul2 <= Uns & "00"; --the Uns 6 bits was added two zeros
to have 8 bits

o.
end process; rs e
ou urc
--Equivalent process using a concurrent statement and is the same as
the other process with wait statement
Mul3 <= Uns & "00";
o
aC s

end architecture;
vi y re

3. Change the file name by adding 13 to T13_ConcurrentProcsTb then save


as T13_ConcurrentProcsTb13.vhd
4. Open Model Sim
ed d

5. Open the created T13_ConcurrentProcsTb13.vhd existing file to the


Model Sim project.
ar stu

6. Compile T13_ConcurrentProcsTb13 until the green check appears which


means no error.
8. Once there is no error after compiling the vhd file click simulate.
is

9. Collapse the work library and choose the T13_ConcurrentProcsTb13 file


you just simulated then click ok.
Th

10. Drag the signal to the wave first column and hit run icon beside the
100 ns, you can see Fig. 5.2.
sh

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
m
er as
co
eH w
Figure 5.1 Toggled Leaf Names of the Signal

o.
You can toggle the signal names located at the lower part of the signal
name. rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

Figure 5.2 Working Collapsed Signal Variable

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
m
er as
co
eH w
Figure 5.3 without radix output

o.
rs e
Figure 5.4 can be seen by typing “radix noshowbase” at the transcript
ou urc
window(from fig.5.3 it is beside the VSIM 25>).
Learnings:
In multiplying the unsigned numbers by 4 you can use “& ”00”.
o

Something like when you add 1 plus 00 becomes “100” which is 4. This is
aC s

what you called bit shifting as shown on the next figure


vi y re
ed d
ar stu

0010 => 1000


0011 => 1100
And so on…
As noticed, the program process used a sensitivity list and another process
is

way of writing a process but the output is still the same. However, there
Th

will be an error if the sensitivity list process has a wait statement.


The concurrent process is simply an assignment to a signal with an
architecture part of the VHDL file but outside the process like “Mul3 <=
Uns & “00”. This concurrent signal is equivalent to the process and
sh

sensitivity list.
11. For Exercise No. 8-1, what if the bits will shift to the right? What will you
do?
Clue: you may or not change the following:
7 downto 0
Uns <= Uns + 1;

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
12. subtype NATURAL is integer range 0 to integer'high;

6. Activity
6.1 Create Exercise No. 8-1 by referring to step number 11 above.
After running it without errors, paste the screenshot of the codes
and the Modelsim Waveform in the next row below. Differentiate
the codes from the first waveform output and the last waveform
output. What makes it different?

m
er as
co
eH w
o.
rs e
ou urc
o
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
m
er as
co
eH w
o.
rs e
ou urc
There were changes on the output waveform as the bits shift from
left going to the right.
o
aC s
vi y re
ed d
ar stu
is
Th
sh

This study source was downloaded by 100000817485283 from CourseHero.com on 09-09-2021 02:16:50 GMT -05:00

https://www.coursehero.com/file/92654782/Exercise-No-7docx/
Powered by TCPDF (www.tcpdf.org)

You might also like