SAP computer之RAM

來源:互聯網
上載者:User

標籤:

RAM

  The RAM is a 16 X 8 static TTL RAM. We can program the RAM by means of the address and data switch registers. This allows us to store a program and data in the memory before a computer run.

  During a computer run, the RAM receive 4-bit addresses from MAR and a read operation is performed. In this way, the instuction or data word stored in the RAM is placed on the W bus for use in some other part of the computer.

 

 1 library IEEE; 2 use ieee.std_logic_1164.all; 3 use ieee.numeric_std.all; 4  5 entity ROM_16_8 is 6 port 7 ( 8     READ     : in     std_logic;                        --! Active low enable ROM signal, (tri-state) 9     ADDRESS  : in     std_logic_vector (3 downto 0);    --! 4-bit ROM address bits from MAR10     DATA_OUT : out    std_logic_vector (7 downto 0)     --! 8-bit ROM output word to W-bus11 );        12 end ROM_16_8 ;13 14 architecture beh of ROM_16_8 is15 16 type mem is array (0 to 15) of std_logic_vector(7 downto 0) ;17 signal rom : mem;18 19 begin20     --! This program works as follow:21     --!22     --! Load 5 to AC (memory content of 9)23     --! Output 5 (content of AC)24     --! Add 7 (memory content of 10) to 5 (AC content)25     --! Output 12 (content of AC)26     --! Add 3 (memory content of 11) to 12 (AC content)27     --! Subtract 4 (memory content of 12) from 15 (AC content)28     --! Output 11 (content of AC)29     rom <= (30             0 => "00001001" ,  -- LDA 9h ... Load AC with the content of memory location 931             1 => "11101111" ,  -- OUT32             2 => "00011010" ,  -- ADD Ah ... Add the contents of memory location A to the AC content and replace the AC33             3 => "11101111" ,  -- OUT34             4 => "00011011" ,  -- ADD Bh ... Add the contents of memory location B to the AC content and replace the AC35             5 => "00101100" ,  -- SUB Ch ... Sub the contents of memory location C from the AC content and replace the AC36             6 => "11101111" ,  -- OUT37             7 => "11111111" ,  -- HLT 38             8 => "11111111" ,39             9 => "00000101" ,   --540             10 => "00000111" ,  --741             11 => "00000011" ,  --342             12 => "00000100" ,  --443             13 => "11111111" , 44             14 => "11111111" , 45             15 => "11111111" );46 47     process (READ,ADDRESS)48     begin49         if READ = ‘0‘ then50             DATA_OUT <= rom(to_integer(unsigned(ADDRESS))) ;51          else52              DATA_OUT <= (DATA_OUT‘range => ‘Z‘);53         end if; 54    end process ;55    56 end beh;

 

SAP computer之RAM

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.