OpenCores
URL https://opencores.org/ocsvn/v6502/v6502/trunk

Subversion Repositories v6502

[/] [v6502/] [trunk/] [branch.vhd] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 Valerio63
library IEEE;
2
use IEEE.std_logic_1164.all;  -- defines std_logic types
3
use IEEE.STD_LOGIC_unsigned.all;
4
use IEEE.STD_LOGIC_arith.all;
5
 
6
-- branch resolving logic
7
entity branch is
8
  port(   op:  in STD_LOGIC_VECTOR(3 downto 0);
9
           n:  in STD_LOGIC;
10
           v:  in STD_LOGIC;
11
           z:  in STD_LOGIC;
12
           c:  in STD_LOGIC;
13
        bres: out STD_LOGIC
14
      );
15
end branch;
16
 
17
architecture comb of branch is
18
begin
19
  process(op,n,v,z,c)
20
  begin
21
    case op is
22
      when "1000" => bres <= '1';    -- BRA
23
      when "0001" => bres <= not n;  -- BPL
24
      when "0011" => bres <= n;      -- BMI
25
      when "0101" => bres <= not v;  -- BVC
26
      when "0111" => bres <= v;      -- BVS
27
      when "1111" => bres <= z;      -- BEQ
28
      when "1101" => bres <= not z;  -- BNE
29
      when "1001" => bres <= not c;  -- BCC
30
      when "1011" => bres <= c;      -- BCS
31
      when others => bres <= '0';
32
    end case;
33
  end process;
34
end comb;
35
 
36
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.