Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- entity PC_Update is
- Port ( N : in STD_LOGIC;
- OV : in STD_LOGIC;
- Z : in STD_LOGIC;
- C : in STD_LOGIC;
- Offset : in STD_LOGIC_VECTOR(4 downto 0);
- BranchType : in STD_LOGIC_VECTOR(2 downto 0);
- Branch : in STD_LOGIC;
- PC : in STD_LOGIC_VECTOR (5 downto 0);
- New_PC : out STD_LOGIC_VECTOR (5 downto 0);
- CarryOUT : out STD_LOGIC);
- end PC_Update;
- architecture Behavioral of PC_Update is
- signal PC_temp : STD_LOGIC_VECTOR(5 downto 0);
- signal depl : STD_LOGIC_VECTOR(5 downto 0);
- begin
- PC_temp <= PC + 2;
- depl <= Offset&"0";
- New_PC <= (PC_temp + depl) when (Branch = '1' and ((BranchType = b"011" and N = '1')
- or (BranchType = b"000" and OV = '1')
- or (BranchType = b"010" and Z = '1')
- or (BranchType = b"001" and C = '1')
- or (BranchType = b"111"))) else
- PC_temp;
- CarryOUT <= C;
- end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement