Figure 9.1 Architecture of a Simple Computer System.

Slides:



Advertisements
Similar presentations
ARITHMETIC LOGIC SHIFT UNIT
Advertisements

Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Top-level VHDL Designs
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
Chapter 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Kazi Fall 2006 EEGN 4941 EEGN-494 HDL Design Principles for VLSI/FPGAs Khurram Kazi Some of the slides were taken from K Gaj’s lecture slides from GMU’s.
The Processor Andreas Klappenecker CPSC321 Computer Architecture.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
4-bit Shift Register. 2-bit Register Serial-in-serial-out Shift Register.
SAP1 (Simple-As-Possible) Computer
LECTURE 8: VHDL PROCESSES
Chapter 14 Introduction to Microprocessors. 2 Microcomputer A self-contained computer system that consists of CPU (central processing unit), memory (RAM.
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
CprE / ComS 583 Reconfigurable Computing
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
A full die photograph of the MIPS R2000 RISC Microprocessor is shown above. The 1986 MIPS R2000 with five pipeline stages and 450,000 transistors was the.
ENG241 Digital Design Week #8 Registers and Counters.
Lab 05 Sen Ma.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
Feb. 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 12: State Elements, Registers, and Memory * Jeremy R. Johnson Mon. Feb.
VHDL for Finite State Machines. Sorry – no standard way One way –Use TYPE and SIGNAL ARCHITECTURE Behavior OF two_ones_fsm IS TYPE State_type IS ( A,
1 MIPS VHDL Overview Reference: VHDL Tutorial on CDROM, or Accolade Reference Guide Notes: / / pdf / MIPS_vhdl_notes.pdf.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
Copyright (c) 2003 by Valery Sklyarov and Iouliia Skliarova: DETUA, IEETA, Aveiro University, Portugal.
July 2, 2001Systems Architecture I1 Systems Architecture II (CS 282) Lab 3: State Elements, Registers, and Memory * Jeremy R. Johnson Monday July 2, 2001.
Figure 9.1 Architecture of a Simple Computer System.
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
Registers and Counters Discussion D8.1. Logic Design Fundamentals - 3 Registers Counters Shift Registers.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
STUDY OF PIC MICROCONTROLLERS.. Design Flow C CODE Hex File Assembly Code Compiler Assembler Chip Programming.
Combinational logic circuit
Basic Computer Organization and Design
SAP1 (Simple-As-Possible) Computer
Main Project : Simple Processor Mini-Project : Vending Machine Memory
Registers and Counters
ECE 4110–5110 Digital System Design
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Lecture on Microcomputer
TITLE ASSEMBLY LANGUAGE DEFINITION FILE FOR UP1 COMPUTER DESIGN WORD 16 WIDTH 72 LINES 50 ;******************************************************************
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
A full die photograph of the MIPS R2000 RISC Microprocessor is shown above. The 1986 MIPS R2000 with five pipeline stages and 450,000 transistors was.
LIBRARY IEEE; Include Libraries for standard logic data types USE IEEE.STD_LOGIC_1164.ALL; -- Entity name normally the same as file name.
Figure 13.1 MIPS Single Clock Cycle Implementation.
Figure 8.1 Architecture of a Simple Computer System.
CS/COE0447 Computer Organization & Assembly Language
CPE 528: Session #7 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
Computer Science 210 Computer Organization
CHAPTER 17 VHDL FOR SEQUENTIAL LOGIC
Computer Organization and ASSEMBLY LANGUAGE
Design of the Control Unit for One-cycle Instruction Execution
Figure 8.1 Architecture of a Simple Computer System.
VHDL (VHSIC Hardware Description Language)
CPE 528: Lecture #5 Department of Electrical and Computer Engineering University of Alabama in Huntsville.
COMS 361 Computer Organization
Founded in Silicon Valley in 1984
MARIE: An Introduction to a Simple Computer
A Discussion on Assemblers
Figure 8.1. The general form of a sequential circuit.
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Program Execution.
Sequntial-Circuit Building Blocks
Instruction execution and ALU
High-Low Guessing Game
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
(Sequential-Circuit Building Blocks)
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Figure 9.1 Architecture of a Simple Computer System.

Figure 9.2 Simple mP 3 Computer Instruction Format.

Figure 9.3 Basic mP 3 Computer Instructions.

Assembly Language MachineLanguage LOAD B 0211 ADD C 0012 STORE A 0110 Figure 9.4 Example Computer Program for A = B + C.

Figure 9.5 Processor Fetch, Decode and Execute Cycle.

Figure 9.6 Detailed View of Fetch, Decode, and Execute for the mP 3 Computer Design.

Figure 9. 7 Datapath used for the mP 3 Computer Design Figure 9.7 Datapath used for the mP 3 Computer Design. Values shown after applying reset.

Figure 9.8 Register transfers in the ADD instruction’s Fetch State.

Figure 9.9 Register transfers in the ADD instruction’s Decode State.

Figure 9.10 Register transfers in the ADD instruction’s Execute State.

-- Simple Computer Model Scomp.vhd LIBRARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; LIBRARY altera_mf; USE altera_mf.altera_mf_components.ALL; ENTITY SCOMP IS PORT( clock, reset : IN STD_LOGIC; program_counter_out : OUT STD_LOGIC_VECTOR( 7 DOWNTO 0 ); register_AC_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0 ); memory_data_register_out : OUT STD_LOGIC_VECTOR(15 DOWNTO 0 )); memory_address_register_out : OUT STD_LOGIC_VECTOR(7 DOWNTO 0 ); memory_write_out : OUT STD_LOGIC); END SCOMP; ARCHITECTURE a OF scomp IS TYPE STATE_TYPE IS ( reset_pc, fetch, decode, execute_add, execute_load, execute_store, execute_store2, execute_jump ); SIGNAL state: STATE_TYPE; SIGNAL instruction_register, memory_data_register : STD_LOGIC_VECTOR(15 DOWNTO 0 ); SIGNAL register_AC : STD_LOGIC_VECTOR(15 DOWNTO 0 ); SIGNAL program_counter : STD_LOGIC_VECTOR( 7 DOWNTO 0 ); SIGNAL memory_address_register : STD_LOGIC_VECTOR( 7 DOWNTO 0 ); SIGNAL memory_write : STD_LOGIC; BEGIN -- Use Altsyncram function for computer's memory (256 16-bit words) memory: altsyncram GENERIC MAP ( operation_mode => "SINGLE_PORT", width_a => 16, widthad_a => 8, lpm_type => "altsyncram", outdata_reg_a => "UNREGISTERED", -- Reads in mif file for initial program and data values init_file => "program.mif", intended_device_family => "Cyclone") PORT MAP (wren_a => memory_write, clock0 => clock, address_a =>memory_address_register, data_a => Register_AC, q_a => memory_data_register ); -- Output major signals for simulation program_counter_out <= program_counter; register_AC_out <= register_AC; memory_data_register_out <= memory_data_register; memory_address_register_out <= memory_address_register;

PROCESS ( CLOCK, RESET ) BEGIN IF reset = '1' THEN state <= reset_pc; ELSIF clock'EVENT AND clock = '1' THEN CASE state IS -- reset the computer, need to clear some registers WHEN reset_pc => program_counter <= "00000000"; register_AC <= "0000000000000000"; state <= fetch; -- Fetch instruction from memory and add 1 to PC WHEN fetch => instruction_register <= memory_data_register; program_counter <= program_counter + 1; state <= decode; -- Decode instruction and send out address of any data operands WHEN decode => CASE instruction_register( 15 DOWNTO 8 ) IS WHEN "00000000" => state <= execute_add; WHEN "00000001" => state <= execute_store; WHEN "00000010" => state <= execute_load; WHEN "00000011" => state <= execute_jump; WHEN OTHERS => state <= fetch; END CASE;

-- Execute the ADD instruction WHEN execute_add => register_ac <= register_ac + memory_data_register; state <= fetch; -- Execute the STORE instruction -- (needs two clock cycles for memory write and fetch mem setup) WHEN execute_store => -- write register_A to memory, enable memory write -- load memory address and data registers for memory write state <= execute_store2; --finish memory write operation and load memory registers --for next fetch memory read operation WHEN execute_store2 => -- Execute the LOAD instruction WHEN execute_load => register_ac <= memory_data_register; state <= fetch; -- Execute the JUMP instruction WHEN execute_jump => program_counter <= instruction_register( 7 DOWNTO 0 ); WHEN OTHERS => state <= fetch; END CASE; END IF; END PROCESS;

-- memory address register is already inside synchronous memory unit -- need to load its value based on current state -- (no second register is used - not inside a process here) WITH state SELECT memory_address_register <= "00000000" WHEN reset_pc, program_counter WHEN fetch, instruction_register(7 DOWNTO 0) WHEN decode, program_counter WHEN execute_add, instruction_register(7 DOWNTO 0) WHEN execute_store, program_counter WHEN execute_store2, program_counter WHEN execute_load, instruction_register(7 DOWNTO 0) WHEN execute_jump; memory_write <= '1' WHEN execute_store, '0' WHEN Others; END a;

Figure 9.12 Verilog Model of mP 3 Computer.

Figure 9.12 Verilog Model of mP 3 Computer.

Figure 9.13 MIF file containg mP Computer Program. DEPTH = 256; % Memory depth and width are required % WIDTH = 16; % Enter a decimal number % ADDRESS_RADIX = HEX; % Address and value radixes are optional % DATA_RADIX = HEX; % Enter BIN, DEC, HEX, or OCT; unless % % otherwise specified, radixes = HEX % -- Specify values for addresses, which can be single address or range CONTENT BEGIN [00..FF] : 0000; % Range--Every address from 00 to FF = 0000 (Default) % 00 : 0210; % LOAD AC with MEM(10) % 01 : 0011; % ADD MEM(11) to AC % 02 : 0112; % STORE AC in MEM(12) % 03 : 0212; % LOAD AC with MEM(12) check for new value of FFFF % 04 : 0304; % JUMP to 04 (loop forever) % 10 : AAAA; % Data Value of B % 11 : 5555; % Data Value of C% 12 : 0000; % Data Value of A - should be FFFF after running program % END ; Figure 9.13 MIF file containg mP Computer Program.

Figure 9.15 Simulation of the Simple mP Computer Program.

Figure 9.16 Simulation display of mP 3 Computer Memory showing result stored in memory