![]() ![]() Getting into this habit will save you quite a lot of hassle later on. Look at your code like this and you'll see that you never assign PCss to any other value other than 0.Īlso, minor note, you should be declaring library ieee and using numeric_std for math. I would advise not putting everything on the if/then line. Yes, of course, however in your code you never actually assign another value to PCss. U1: process(RESET,CLK) begin if reset = '1' then PC <= x"00" elsif CLK'event and CLK = '1' then if PS = "01" then PC <= PCss + '1' elsif PS = "10" then PC <= PCss + Offset elsif PS = "11" then PC <= Address_In else end if end if end process Signal PCss: STD_LOGIC_VECTOR (7 downto 0) := "00000000" begin The program counter, which is part of the control unit, counts from 0000 to 1111 as the program is stored at the beginning of the memory with the first. Any advice?Įntity ProgramCounter is Port ( Reset : in STD_LOGIC CLK : in STD_LOGIC Address_In : in STD_LOGIC_VECTOR (7 downto 0) PS : in STD_LOGIC_VECTOR (1 downto 0) Offset : in STD_LOGIC_VECTOR (7 downto 0) PC : out STD_LOGIC_VECTOR (7 downto 0)) end ProgramCounter Īrchitecture Behavioral of ProgramCounter is subsystem, a program counter (PC) to store the address of the next instruction. ![]() my guess is that it keeps getting told its value is "00000000". Unit 4 : Basic components of Microcomputer and its design using VHDL. ![]() But when im simulating it it only increments one time. Is there a way to assign an initial value to a vector and then it stays that value until told otherwise? I've tried to give the signal vector PCss the value "00000000" and then the idea is to increment it with every clk cycle if PS is "01". Been working on a programcounter for a larger project in my VHDL class. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |