SAP computer之RAM

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 MAR
10     DATA_OUT : out    std_logic_vector (7 downto 0)     --! 8-bit ROM output word to W-bus
11 );
12 end ROM_16_8 ;
13
14 architecture beh of ROM_16_8 is
15
16 type mem is array (0 to 15) of std_logic_vector(7 downto 0) ;
17 signal rom : mem;
18
19 begin
20     --! 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 9
31             1 => "11101111" ,  -- OUT
32             2 => "00011010" ,  -- ADD Ah ... Add the contents of memory location A to the AC content and replace the AC
33             3 => "11101111" ,  -- OUT
34             4 => "00011011" ,  -- ADD Bh ... Add the contents of memory location B to the AC content and replace the AC
35             5 => "00101100" ,  -- SUB Ch ... Sub the contents of memory location C from the AC content and replace the AC
36             6 => "11101111" ,  -- OUT
37             7 => "11111111" ,  -- HLT
38             8 => "11111111" ,
39             9 => "00000101" ,   --5
40             10 => "00000111" ,  --7
41             11 => "00000011" ,  --3
42             12 => "00000100" ,  --4
43             13 => "11111111" ,
44             14 => "11111111" ,
45             15 => "11111111" );
46
47     process (READ,ADDRESS)
48     begin
49         if READ = ‘0‘ then
50             DATA_OUT <= rom(to_integer(unsigned(ADDRESS))) ;
51          else
52              DATA_OUT <= (DATA_OUT‘range => ‘Z‘);
53         end if;
54    end process ;
55
56 end beh;
时间: 2024-08-08 22:01:46

SAP computer之RAM的相关文章

SAP computer之input and MAR

Input and MAR Below the program counter is the input and MAR block. It includes the address and data switch registers. These switch registers are part of the input unit which allow you to send 4 address bits and 8 data bits to RAM. As you recall, ins

SAP computer之program counter

Program counter The program is stored in memory with the first instruction at binary address 0000, the second instruction at address 0001, the third at address 0010 and so on.  The program counter, which is part of the control unit, counts from 0000

SAP computer之architecture

Simple-As-Possible computer introduces all the cruicial ideas behind computer operation without burying you in unnecessary detail. The figure shows the architecture of SAP-1, a bus-organized computer. All register outputs to the W bus are three-state

堆栈 &amp; Stack and Heap

What's the difference between a stack and a heap? The differences between the stack and the heap can be confusing for many people. So, we thought we would have a list of questions and answers about stacks and heaps that we thought would be very helpf

PostgreSQL Hardware Performance Tuning

Bruce Momjian POSTGRESQL is an object-relational database developed on the Internet by a group of developers spread across the globe. It is an open-source alternative to commercial databases like Oracle and Informix. POSTGRESQL was originally develop

VMware12 安装 CentOS 6.5 64位

前言:本人在配置Hadoop的过程中,需要搭建Cent OS 64 环境,借此,顺便将Cent OS 64 的安装在此记录,方便自己,也方便大家学习.本次是在VM12虚拟机中实现Cent OS 64 的安装以及配置,后续还会有Hadoop的安装配置教程,我们先来进行第一步. 一.VMware 12 Install CentOS 64(Linux)OS create a new vm->there I screenshot my settings in the next steps-> keep

建造者模式详解

定义:将一个复杂的构建与他的表示分离,使得同样的构建过程可以创建不同的表示. public class Computer { private String cpu; private String mainBoard; private String ram; public String getCpu() { return cpu; } public void setCpu(String cpu) { this.cpu = cpu; } public String getMainBoard() {

MongoDB十二种最有效的模式设计【转】

持续关注MongoDB博客(https://www.mongodb.com/blog)的同学一定会留意到,技术大牛Daniel Coupal 和 Ken W. Alger ,从 今年 2月17 号开始,在博客上持续发表了 如何在MongoDB中设计数据库模式的方法.截止到今日(4月20号),12种模式设计的方法已全部与读者见面.本人认为,此系列文章,总结的非常全面,很多地方有首创性,涵盖的场景也很多,并且有理论总结,也有案例分析.文中分享的很多知识使人"如听仙乐耳暂明",开卷受益,常读

SAP事务码 一

SE80 -- edit source code. SE24 -- class create or display. SFP -- created and maintained independently of Web Dynpro applications using the Form Builder. SFW1 SFW2 SFW3 -- 与增强有关 SY-SUBRC 返 回代码值( 0,如果操 作成功)   SY-UNAME 用 户的登录名   SY-DATUM 当 前日期   SY-UZE