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

Subversion Repositories pdp8

[/] [pdp8/] [trunk/] [pdp8/] [cpu/] [mqa.vhd] - Blame information for rev 6

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 trurl
------------------------------------------------------------------
2
--!
3
--! PDP-8 Processor
4
--!
5
--! \brief
6
--!      CPU Multiplier Quotient Auxillary Register (MQA)
7
--!
8
--! \details
9
--!      The Multiplier Quotient Auxillary Register (MQA) is a
10
--!      temporary register used during EAE shift and divide
11
--!      instructions.
12
--!
13
--! \todo
14
--!      Is the MQA register really necessary?  Can it be
15
--!      deleted and the instructions be re-written?
16
--!
17
--! \file
18
--!      mqa.vhd
19
--!
20
--! \author
21
--!      Rob Doyle - doyle (at) cox (dot) net
22
--!
23
--------------------------------------------------------------------
24
--
25
--  Copyright (C) 2009, 2010, 2011 Rob Doyle
26
--
27
-- This source file may be used and distributed without
28
-- restriction provided that this copyright statement is not
29
-- removed from the file and that any derivative work contains
30
-- the original copyright notice and the associated disclaimer.
31
--
32
-- This source file is free software; you can redistribute it
33
-- and/or modify it under the terms of the GNU Lesser General
34
-- Public License as published by the Free Software Foundation;
35
-- version 2.1 of the License.
36
--
37
-- This source is distributed in the hope that it will be
38
-- useful, but WITHOUT ANY WARRANTY; without even the implied
39
-- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
40
-- PURPOSE. See the GNU Lesser General Public License for more
41
-- details.
42
--
43
-- You should have received a copy of the GNU Lesser General
44
-- Public License along with this source; if not, download it
45
-- from http://www.gnu.org/licenses/lgpl.txt
46
--
47
--------------------------------------------------------------------
48
--
49
-- Comments are formatted for doxygen
50
--
51
 
52
library ieee;                                   --! IEEE Library
53
use ieee.std_logic_1164.all;                    --! IEEE 1164
54
use work.cpu_types.all;                         --! Types
55
 
56
--
57
--! CPU Auxillary Multiplier Quotient Register (MQA) Entity
58
--
59
 
60
entity eMQA is port (
61
    sys   : in  sys_t;                          --! Clock/Reset
62
    mqaOP : in  mqaop_t;                        --! MQA Operation
63
    MQ    : in  data_t;                         --! MQ Register
64
    MQA   : out data_t                          --! MQA Output
65
);
66
end eMQA;
67
 
68
--
69
--! CPU Auxillary Multiplier Quotient Register (MQA) RTL
70
--
71
 
72
architecture rtl of eMQA is
73
 
74
    signal mqaREG : data_t;                     --! Aux Multiplier Quotient Register
75
    signal mqaMUX : data_t;                     --! Aux Multiplier Quotient Multiplexer
76
 
77
begin
78
 
79
    --
80
    -- MQ Multiplexer
81
    --
82
 
83
    with mqaOP select
84
        mqaMUX <= mqaREG                when mqaopNOP,  -- MQA <- MQ
85
                  o"0000"               when mqaopCLR,  -- MQA <- "0000"
86
                  MQ                    when mqaopMQ,   -- MQA <- MQ
87
                  mqaREG(1 to 11) & '0' when mqaopSHL;  -- MQA <- (MQA << 1)
88
 
89
    --
90
    --! MQA Register
91
    --
92
 
93
    REG_MQA : process(sys)
94
    begin
95
        if sys.rst = '1' then
96
            mqaREG <= o"0000";
97
        elsif rising_edge(sys.clk) then
98
            mqaREG <= mqaMUX;
99
        end if;
100
    end process REG_MQA;
101
 
102
    MQA <= mqaREG;
103
 
104
end rtl;

powered by: WebSVN 2.1.0

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