Design Problem 6 Solution
|
|
- Rosa Robertson
- 6 years ago
- Views:
Transcription
1 CSE 260 Digital Computers: Organization and Logical Design Design Problem 6 Solution Jon Turner The modifications to the VHDL for the console appear below entity console end console; architecture a1 of console is -- registers for counting memory operations by processor signal readcount, writecount: std_logic_vector(19 downto 0); begin -- process for counting memory operations process(clk) begin if rising_edge(clk) then if reset = '1' then readcount <= (others => '0'); writecount <= (others => '0'); elsif memenin = '1' then if memrwin = '1' then readcount <= readcount + 1; writecount <= writecount + 1; end process; -- process for updating display selekt <= dispcntr(4 downto 0); process(clk) begin if rising_edge(clk) then if reset = '1' then dispcntr <= (others => '0'); regselect <= (others => '0'); dispcntr <= dispcntr + 1; - 1 -
2 update <= '0'; if dispcntr(15 downto 5) = x"00" & "000" then update <= '1'; nuchar <= x"20"; case dispcntr(4 downto 0) is when "00000" => regselect <= "00"; when "01011" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopadr(15 downto 12))); nuchar <= hex2ascii(int(readcount(19 downto 16))); when "01100" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopadr(11 downto 8))); nuchar <= hex2ascii(int(readcount(15 downto 12))); when "01101" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopadr(7 downto 4))); nuchar <= hex2ascii(int(readcount(11 downto 8))); when "01110" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopadr(3 downto 0))); nuchar <= hex2ascii(int(readcount(7 downto 4))); when "01111" => if swt(0) = '0' then nuchar <= x"20"; nuchar <= hex2ascii(int(readcount(3 downto 0))); when "11011" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopdata(15 downto 12))); nuchar <= hex2ascii(int(writecount(19 downto 16))); when "11100" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopdata(11 downto 8))); nuchar <= hex2ascii(int(writecount(15 downto 12))); when "11101" => - 2 -
3 if swt(0) = '0' then nuchar <= hex2ascii(int(snoopdata(7 downto 4))); nuchar <= hex2ascii(int(writecount(11 downto 8))); when "11110" => if swt(0) = '0' then nuchar <= hex2ascii(int(snoopdata(3 downto 0))); nuchar <= hex2ascii(int(writecount(7 downto 4))); when "11111" => if swt(0) = '0' then nuchar <= x"20"; nuchar <= hex2ascii(int(writecount(3 downto 0))); when others => end case; end process; end a1;% - 3 -
4 The simulation output for part 1 is shown below. We note that the program finishes writing the maze at ms and that the final value of the read and write counts is 415,836 and 71,478. The simulation also shows the last few squares being written, providing some basic confirmation that the program is working correctly. As we make changes to the processor, we expect to see the same set of values being written to the display buffer
5 The simulation results for the second part are shown below. We note that the data written for the last few squares are consistent with the baseline simulation from part 1, that the time to write the maze is 17.1 ms and that the number of memory reads has dropped to 226,
6 The modified VHDL appears below. entity cpucache end cpucache; architecture a1 of cpucache is -- instruction cache words long -- to get synthesizer to use RAM rather than flops, -- it's necessary to define cache as array of std_logic_vectors -- rather than an array of records subtype icacherawword is std_logic_vector(24 downto 0); type icachetype is array(0 to 255) of icacherawword; signal icache: icachetype; type icacheword is record valid: std_logic; tag: std_logic_vector(15 downto 8); value: word; end record; signal icacheadr: std_logic_vector(7 downto 0); signal icachetag: std_logic_vector(15 downto 8); signal icacherawout: icacherawword; signal icacheout: icacheword; signal icachein: word; signal icachematch: std_logic; signal cachecount: std_logic_vector(7 downto 0); signal initcache: std_logic; begin icacheadr <= cachecount when initcache = '1' pc(7 downto 0) when state = fetch ireg(7 downto 0) when state = dstore iar(7 downto 0) when state = istore (others => '0'); icachetag <= pc(15 downto 8) when state = fetch pctop & ireg(11 downto 8) when state = dstore iar(15 downto 8) when state = istore (others => '0'); icacherawout <= icache(int(icacheadr)); icacheout <= (icacherawout(24), icacherawout(23 downto 16), icacherawout(15 downto 0)); icachematch <= '1' when icacheout.valid = '1' and icacheout.tag = icachetag '0' - 6 -
7 -- instruction cache process process (clk) begin if rising_edge(clk) then if reset = '1' then initcache <= '1'; cachecount <= (others => '0'); elsif initcache = '1' then cachecount <= cachecount + 1; icache(int(icacheadr)) <= (others => '0'); if cachecount = x"ff" then initcache <= '0'; elsif state = fetch and tick = x"1" then icache(int(icacheadr)) <= ('1' & icachetag & dbus); elsif icacheout.tag = icachetag then if state = dstore or (state = istore and tick = x"2") then icache(int(icacheadr)) <= ('1' & icachetag & acc); end process; process (clk) function decode(instr: word) return state_type is begin end function decode; procedure wrapup is begin end procedure wrapup; begin if rising_edge(clk) then if reset = '1' or initcache = '1' then tick <= tick + 1; -- advance time by default if state = resetstate then state <= fetch; tick <= x"0"; elsif state = pausestate then elsif state = fetch then end process; end a1; - 7 -
8 The simulation output for part 3 is shown below. Observe that the writing of the last few squares remains consistent with the earlier runs. Also note that the time to complete the maze has dropped to ms and the number of reads has dropped to 210,
9 The modifications to the CPU for part 4 are shown below. entity cpucache end cpucache; architecture a1 of cpucache is -- target address for branch instructions signal branchtarget: word; -- cache rows, two words per row subtype cacherawword is std_logic_vector(25 downto 0); type cachetype is array(0 to 127) of cacherawword; signal lcache, rcache: cachetype; type cacheword is record valid: std_logic; tag: std_logic_vector(15 downto 7); value: word; end record; signal lru: std_logic_vector(0 to 127); signal cacheadr: std_logic_vector(6 downto 0); signal cachetag: std_logic_vector(15 downto 7); signal leftcacherawout, rightcacherawout: cacherawword; signal leftcacheout, rightcacheout: cacheword; signal cachematch, leftmatch, rightmatch: std_logic; signal cachecount: std_logic_vector(6 downto 0); signal initcache: std_logic; begin branchtarget <= dpc + iregsx8; cacheadr <= cachecount when initcache = '1' pc(6 downto 0) when state = fetch ireg(6 downto 0) when state = dstore iar(6 downto 0) when state = istore (others => '0'); cachetag <= pc(15 downto 7) when state = fetch pctop & ireg(11 downto 7) when state = dstore iar(15 downto 7) when state = istore (others => '0'); leftcacherawout <= lcache(int(cacheadr)); leftcacheout <= ( leftcacherawout(25), leftcacherawout(24 downto 16), leftcacherawout(15 downto 0)); rightcacherawout <= rcache(int(cacheadr)); rightcacheout <= (rightcacherawout(25), rightcacherawout(24 downto 16), rightcacherawout(15 downto 0)); leftmatch <= '1' when leftcacheout.valid = '1' and - 9 -
10 leftcacheout.tag = cachetag '0'; rightmatch <= '1' when rightcacheout.valid = '1' and rightcacheout.tag = cachetag '0'; cachematch <= leftmatch or rightmatch; -- update cache and lru bits process (clk) begin if rising_edge(clk) then if reset = '1' then initcache <= '1'; cachecount <= (others => '0'); elsif initcache = '1' then cachecount <= cachecount + 1; lcache(int(cacheadr)) <= (others => '0'); rcache(int(cacheadr)) <= (others => '0'); lru(int(cacheadr)) <= '0'; if cachecount = x"7f" then initcache <= '0'; elsif state = fetch and tick = x"1" then if lru(int(cacheadr)) = '0' then lcache(int(cacheadr)) <= ('1' & cachetag & dbus); rcache(int(cacheadr)) <= ('1' & cachetag & dbus); lru(int(cacheadr)) <= not lru(int(cacheadr)); elsif cachematch = '1' then if state = dstore or (state = istore and tick = x"2") then if leftmatch = '1' then lcache(int(cacheadr)) <= ('1' & cachetag & acc); rcache(int(cacheadr)) <= ('1' & cachetag & acc); lru(int(cacheadr)) <= not lru(int(cacheadr)); end process; alu <= (not acc) + 1 when state = negate not acc when state = nott acc + dbus when state = add acc and dbus when state = andd acc or dbus when state = orr leftshift(acc, dbus(3 downto 0)) when state = lshift and dbus(15 downto 4) = x"000" rightshift(acc, dbus(3 downto 0)) when state = rshift and dbus(15 downto 4) = x"000" x 0000 ; process (clk)
11 function decode end function decode; procedure wrapup end procedure wrapup; begin if rising_edge(clk) then if reset = '1' or initcache = '1' then tick <= tick + 1; -- advance time by default if state = resetstate then elsif state = pausestate then elsif state = fetch then if tick = x"0" then -- check cache for data if leftmatch = '1' then state <= decode(leftcacheout.value); ireg <= leftcacheout.value; dpc <= pc; pc <= pc+1; tick <= x"0"; elsif rightmatch = '1' then state <= decode(rightcacheout.value); ireg <= rightcacheout.value; dpc <= pc; pc <= pc+1; tick <= x"0"; elsif tick = x"1" then ireg <= dbus; elsif tick = x"2" then state <= decode(ireg); dpc <= pc; pc <= pc + 1; tick <= x"0"; case state is end case; end process; process (ireg,pc,iar,acc,dpc,pctop,state,tick,cachematch,iregsx8) begin end process; end a1;
12 The simulation output for part 4 is shown below. Again, note that the writing of the last few squares remains consistent with the earlier runs. Also note that the time to complete the maze has dropped to ms and the number of reads has dropped to 190,
13 The CPU modifications for the extra credit part appear below. entity cpucache end cpucache; architecture a1 of cpucache is signal aluin: word; -- secondary alu data output -- target address for branch instructions signal branchtarget: word; -- cache rows, two words per row subtype cacherawword is std_logic_vector(25 downto 0); type cachetype is array(0 to 127) of cacherawword; signal lcache, rcache: cachetype; type cacheword is record valid: std_logic; tag: std_logic_vector(15 downto 7); value: word; end record; signal lru: std_logic_vector(0 to 127); signal cacheadr: std_logic_vector(6 downto 0); signal cachetag: std_logic_vector(15 downto 7); signal leftcacherawout, rightcacherawout: cacherawword; signal leftcacheout, rightcacheout: cacheword; signal cachematch, leftmatch, rightmatch: std_logic; signal cachecount: std_logic_vector(6 downto 0); signal initcache: std_logic; begin branchtarget <= dpc + iregsx8; cacheadr <= cachecount when initcache = '1' pc(6 downto 0) when state = fetch iar(6 downto 0) when (state = iload or state = istore) and tick >= x"2" branchtarget(6 downto 0) when state = brind ireg(6 downto 0); cachetag <= pc(15 downto 7) when state = fetch iar(15 downto 7) when (state=iload or state=istore) and tick >= x"2" branchtarget(15 downto 7) when state = brind pctop & ireg(11 downto 7); leftcacherawout <= lcache(int(cacheadr)); leftcacheout <= ( leftcacherawout(25), leftcacherawout(24 downto 16), leftcacherawout(15 downto 0)); rightcacherawout <= rcache(int(cacheadr));
14 rightcacheout <= (rightcacherawout(25), rightcacherawout(24 downto 16), rightcacherawout(15 downto 0)); leftmatch <= '1' when leftcacheout.valid = '1' and leftcacheout.tag = cachetag '0'; rightmatch <= '1' when rightcacheout.valid = '1' and rightcacheout.tag = cachetag '0'; cachematch <= leftmatch or rightmatch; -- update cache and lru bits process (clk) begin if rising_edge(clk) then if reset = '1' then initcache <= '1'; cachecount <= (others => '0'); elsif initcache = '1' then cachecount <= cachecount + 1; lcache(int(cacheadr)) <= (others => '0'); rcache(int(cacheadr)) <= (others => '0'); lru(int(cacheadr)) <= '0'; if cachecount = x"7f" then initcache <= '0'; elsif ((state = fetch or state = dload or state= add or state = andd or state = orr or state = lshift or state = rshift or state = brind or state = iload or state = istore) and tick = x"1") or (state = iload and tick = x"3") then if lru(int(cacheadr)) = '0' then lcache(int(cacheadr)) <= ('1' & cachetag & dbus); rcache(int(cacheadr)) <= ('1' & cachetag & dbus); lru(int(cacheadr)) <= not lru(int(cacheadr)); elsif cachematch = '1' then if state = dstore or (state = istore and tick = x"2") then if leftmatch = '1' then lcache(int(cacheadr)) <= ('1' & cachetag & acc); rcache(int(cacheadr)) <= ('1' & cachetag & acc); lru(int(cacheadr)) <= not lru(int(cacheadr)); elsif ((state = dload or state= add or state = andd or state = orr or state = lshift or state = rshift or state = brind or state = iload or state = istore) and tick = x"0") or (state = iload and tick = x"2") then lru(int(cacheadr)) <= leftmatch; end process;
15 aluin <= leftcacheout.value when leftmatch = '1' rightcacheout.value when rightmatch = '1' dbus; alu <= (not acc) + x"0001" when state = negate not acc when state = nott acc + aluin when state = add acc and aluin when state = andd acc or aluin when state = orr leftshift(acc, aluin(3 downto 0)) when state = lshift and aluin(15 downto 4) = x"000" rightshift(acc, aluin(3 downto 0)) when state = rshift and aluin(15 downto 4) = x"000" aluin; process (clk) function decode end function decode; procedure wrapup end procedure wrapup; begin if rising_edge(clk) then if reset = '1' or initcache = '1' then tick <= tick + 1; -- advance time by default if state = resetstate then elsif state = pausestate then elsif state = fetch then if tick = x"0" then -- check cache for data if leftmatch = '1' then state <= decode(leftcacheout.value); ireg <= leftcacheout.value; dpc <= pc; pc <= pc+1; tick <= x"0"; elsif rightmatch = '1' then state <= decode(rightcacheout.value); ireg <= rightcacheout.value; dpc <= pc; pc <= pc+1; tick <= x"0"; elsif tick = x"1" then ireg <= dbus; elsif tick = x"2" then state <= decode(ireg); dpc <= pc; pc <= pc + 1; tick <= x"0";
16 case state is when negate nott => acc <= alu; wrapup; -- branch instructions when branch => pc <= dpc + iregsx8; wrapup; when brzero => if acc = x"0000" then pc <= dpc + iregsx8; wrapup; when brpos => if acc(15) = '0' and acc /= x"0000" then pc <= dpc + iregsx8; wrapup; when brneg => if acc(15) = '1' then pc <= dpc + iregsx8; wrapup; when brind => if tick = x"0" then if cachematch = '1' then pc <= alu; wrapup; elsif tick = x"1" then pc <= dbus; wrapup; -- load instructions when mload => acc <= iregsx4; wrapup; when dload => if tick = x"0" then if cachematch = '1' then acc <= alu; wrapup; elsif tick = x"1" then acc <= dbus; wrapup; when iload => if tick = x"0" then if cachematch = '1' then iar <= alu; tick <= x"2"; elsif tick = x"1" then iar <= dbus; elsif tick = x"2" then if cachematch = '1' then acc <= alu; wrapup;
17 elsif tick = x"3" then acc <= dbus; wrapup; -- store instructions when dstore => wrapup; when istore => if tick = x"0" then if cachematch = '1' then iar <= alu; tick <= x"2"; elsif tick = x"1" then iar <= dbus; elsif tick = x"2" then wrapup; -- arithmetic and logic instructions when add andd orr lshift rshift => if tick = x"0" then if cachematch = '1' then acc <= alu; wrapup; elsif tick = x"1" then acc <= alu; wrapup; when others => state <= halt; end case; end process; process (ireg,pc,iar,acc,dpc,pctop,state,tick,cachematch,iregsx8) begin -- Memory control section (combinational) -- default values for memory control signals en <= '0'; rw <= '1'; abus <= (others => 'Z'); dbus <= (others => 'Z'); case state is when fetch => if tick = x"0" and cachematch = '0' then en <= '1'; abus <= pc; when brind => if tick = x"0" and cachematch = '0' then en <= '1'; abus <= dpc + iregsx8; when dload add andd orr lshift rshift => if tick = x"0" and cachematch = '0' then en <= '1'; abus <= pctop & ireg(11 downto 0);
18 when iload => if tick = x"0" and cachematch = '0' then en <= '1'; abus <= pctop & ireg(11 downto 0); elsif tick = x"2" and cachematch = '0' then en <= '1'; abus <= iar; when dstore => en <= '1'; rw <= '0'; abus <= pctop & ireg(11 downto 0); dbus <= acc; when istore => if tick = x"0" and cachematch = '0' then en <= '1'; abus <= pctop & ireg(11 downto 0); elsif tick = x"2" then en <= '1'; rw <= '0'; abus <= iar; dbus <= acc; when others => end case; end process; end a1;
19 The simulation output for the extra credit part is shown below. Again, note that the writing of the last few squares remains consistent with the earlier runs. Also note that the time to complete the maze has dropped to 13.4 ms and the number of reads has dropped to 68,769. It s also interesting to note in the second line from the bottom that there are long stretches where the read count is not changing, indicating that all memory reads during that period are hitting the cache
20 The table with the results from all parts is shown below. The first column shows the time for the maze program to complete. We see a reduction at each step as the cache becomes larger and/or more sophisticated. The final version produces a run time that is just over half the original. The second column shows the number of reads, which also drops as we go down in the table. It s striking that the combined instruction and data cache gives a large reduction in memory reads (almost a factor of 3 difference from the previous case), but it gives only a small reduction in run-time. The reason for this is that on the Washu2, each memory read costs just two clock cycles, since it uses on-chip SRAM and the clock period is fairly long. Since the combined I-D cache saves us about 120,000 reads, this translates to 2.4 million ns or 2.4 ms, which is roughly the difference in the run times for the last to rows. The third column shows the number of memory writes, which never changes. The penultimate column shows the minimum clock period reported by the synthesizer, and the last column shows what the run time of the program would be, if the processor clock was adjusted to match the minimum clock period. We note that the fastest completion time for the program is for the first cache design. While the others reduce the number of memory accesses, they do require a larger clock period, and this leads to worse overall performance. It s also worth noting that the no-cache case is only about 20% slower than the fastest cache-based design. This illustrates that a fast simple circuit can sometimes be a better choice than a more sophisticated but slower circuit. One should not conclude from this that cache s aren t worth the trouble. For a processor in which the memory access time is much larger than the instruction execution time, caches are indispensable. However, on a processor like the WashU-2, a cache provides a relatively small improvement
Introduction to Computer Design
Introduction to Computer Design Memory (W 800-840) Basic processor operation Processor organization Executing instructions Processor implementation using VHDL 1 Random Access Memory data_in address read/write
More informationDesign Problem 5 Solutions
CS/EE 260 Digital Computers: Organization and Logical Design Design Problem 5 Solutions Jon Turner Due 5/4/04 1. (100 points) In this problem, you will implement a simple shared memory multiprocessor system
More informationDesign Problem 5 Solution
CSE 260 Digital Computers: Organization and Logical Design Design Problem 5 Solution Jon Turner Due 5/3/05 1. (150 points) In this problem, you are to extend the design of the basic processor to implement
More informationCSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014
CSE 260 Introduction to Digital Logic and Computer Design Jonathan Turner Exam 1 Your name 2/13/2014 1. (10 points) Draw a logic diagram that implements the expression A(B+C)(C +D)(B+D ) directly (do not
More informationCS/EE Homework 9 Solutions
CS/EE 260 - Homework 9 Solutions 4/16/2001 1. (20 points) Consider the program on page 1-21 and 1-22 of the lecture notes. Suppose the simple processor is augmented with a direct-mapped instruction cache
More informationCSE 260 Digital Computers: Organization and Logical Design. Exam 2 Solutions
CSE 260 Digital Computers: Organization and Logical Design Exam 2 Solutions Jon Turner 1. (10 points). The table at right shows a table with 5 rows and three columns with each column having a heading.
More informationDesign Problem 4 Solutions
CSE 260 Digital Computers: Organization and Logical Design Design Problem 4 Solutions Jon Turner The block diagram appears below. The controller includes a state machine with three states (normal, movecursor,
More informationProblem Set 10 Solutions
CSE 260 Digital Computers: Organization and Logical Design Problem Set 10 Solutions Jon Turner thru 6.20 1. The diagram below shows a memory array containing 32 words of 2 bits each. Label each memory
More informationCSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions
CSE 6 Introduction to igital Logic and Computer esign Exam Solutions Jonathan Turner /3/4. ( points) raw a logic diagram that implements the expression (B+C)(C +)(B+ ) directly (do not simplify first),
More informationCSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012
CSE 260 Digital Computers: Organization and Logical Design Exam 2 Jon Turner 3/28/2012 1. (15 points). Draw a diagram for a circuit that implements the VHDL module shown below. Your diagram may include
More informationThe CPU Bus : Structure 0
The CPU Bus : Structure 0 The following can be applied to both the internal CPU buses and the external system buses. This distinction becomes blurred when we discuss Systems on a single Chip (SoC). The
More informationDesign Problem 3 Solutions
CSE 260 Digital Computers: Organization and Logical Design Jon Turner Design Problem 3 Solutions In this problem, you are to design, simulate and implement a sequential pattern spotter, using VHDL. This
More informationSummary of FPGA & VHDL
FYS4220/9220 Summary of FPGA & VHDL Lecture #6 Jan Kenneth Bekkeng, University of Oslo - Department of Physics 16.11.2011 Curriculum (VHDL & FPGA part) Curriculum (Syllabus) defined by: Lectures Lecture6:
More informationSequential Statement
Sequential Statement Sequential Logic Output depends not only on current input values but also on previous input values. Are building blocks of; Counters Shift registers Memories Flip flops are basic sequential
More informationProblem Set 1 Solutions
CSE 260 Digital Computers: Organization and Logical Design Jon Turner Problem Set 1 Solutions 1. Give a brief definition of each of the following parts of a computer system: CPU, main memory, floating
More informationSequential Logic - Module 5
Sequential Logic Module 5 Jim Duckworth, WPI 1 Latches and Flip-Flops Implemented by using signals in IF statements that are not completely specified Necessary latches or registers are inferred by the
More informationSign here to give permission for your test to be returned in class, where others might see your score:
EEL 4712 Midterm 2 Spring 216 VERSION 1 Name: UFID: Sign here to give permission for your test to be returned in class, where others might see your score: IMPORTANT: Please be neat and write (or draw)
More informationCOVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:
EEL 4712 Midterm 1 Spring 2012 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer
More informationLecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems
EE 3610: Digital Systems 1 Lecture 4: Modeling in VHDL (Continued ) Sequential Statements Use Process process (sensitivity list) variable/constant declarations Sequential Statements end process; 2 Sequential
More informationVHDL in 1h. Martin Schöberl
VHDL in 1h Martin Schöberl VHDL /= C, Java, Think in hardware All constructs run concurrent Different from software programming Forget the simulation explanation VHDL is complex We use only a small subset
More informationThe University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution
5.3(a)(2), 5.6(c)(2), 5.2(2), 8.2(2), 8.8(2) The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 25 Homework #6 Solution 5.3 (a) For the following SM chart:
More informationComputer-Aided Digital System Design VHDL
بس م اهلل الر حم ن الر حی م Iran University of Science and Technology Department of Computer Engineering Computer-Aided Digital System Design VHDL Ramin Rajaei ramin_rajaei@ee.sharif.edu Modeling Styles
More informationControl and Datapath 8
Control and Datapath 8 Engineering attempts to develop design methods that break a problem up into separate steps to simplify the design and increase the likelihood of a correct solution. Digital system
More informationSolution to Assignment 3 RTL Design
EECE 379 : DESIGN OF DIGITAL AND MICROCOMPUTER SYSTEMS 2000/2001 WINTER SESSION, TERM 1 Solution to Assignment 3 RTL Design Question 1 The cputypes Package This package defines the types and constants
More informationFSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques
FSM Components XST features: Specific inference capabilities for synchronous Finite State Machine (FSM) components. Built-in FSM encoding strategies to accommodate your optimization goals. You may also
More informationInferring Storage Elements
Inferring Storage Elements In our designs, we usually use flip-flops as our storage elements. Sometimes we use latches, but not often. Latches are smaller in size, but create special, often difficult situations
More informationProblem Set 5 Solutions
Problem Set 5 Solutions library ieee; use ieee.std_logic_1164.all; use work.std_arith.all; -- here is the declaration of entity entity la_rewarder is port (clk, go, SRAM_busy, SRAM_rdy: in std_logic; min:
More informationVHDL And Synthesis Review
VHDL And Synthesis Review VHDL In Detail Things that we will look at: Port and Types Arithmetic Operators Design styles for Synthesis VHDL Ports Four Different Types of Ports in: signal values are read-only
More informationIn our case Dr. Johnson is setting the best practices
VHDL Best Practices Best Practices??? Best practices are often defined by company, toolset or device In our case Dr. Johnson is setting the best practices These rules are for Class/Lab purposes. Industry
More informationVHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University
VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University 1 The Wait Statement Syntax wait until condition; Different forms wait until(clk event and clk = 1 ); wait
More informationEITF35: Introduction to Structured VLSI Design
EITF35: Introduction to Structured VLSI Design Part 2.2.2: VHDL-3 Liang Liu liang.liu@eit.lth.se 1 Outline Inference of Basic Storage Element Some Design Examples DFF with enable Counter Coding Style:
More informationCprE 583 Reconfigurable Computing
Recap 4:1 Multiplexer CprE / ComS 583 Reconfigurable Computing Prof. Joseph Zambreno Department of Electrical and Computer Engineering Iowa State University Lecture #18 VHDL for Synthesis I LIBRARY ieee
More informationEITF35: Introduction to Structured VLSI Design
EITF35: Introduction to Structured VLSI Design Part 2.2.2: VHDL-3 Liang Liu liang.liu@eit.lth.se 1 Outline Inference of Basic Storage Element Some Design Examples DFF with enable Counter Coding Style:
More informationField Programmable Gate Array
Field Programmable Gate Array System Arch 27 (Fire Tom Wada) What is FPGA? System Arch 27 (Fire Tom Wada) 2 FPGA Programmable (= reconfigurable) Digital System Component Basic components Combinational
More informationSchedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a
ECE U530 Digital Hardware Synthesis Prof. Miriam Leeser mel@coe.neu.edu November 8, 2006 Midterm Average: 70 Lecture 16: Midterm Solutions Homework 6: Calculator Handshaking HW 6: Due Wednesday, November
More informationEE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 15 Memories
EE 459/500 HDL Based Digital Design with Programmable Logic Lecture 15 Memories 1 Overview Introduction Memories Read Only Memories Random Access Memories FIFOs 2 1 Motivation Most applications need memory!
More informationVHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2
VHDL: Modeling RAM and Register Files Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2 Memory Synthesis Approaches: Random logic using flip-flops or latches Register files in datapaths RAM standard components
More informationLecture 5: State Machines, Arrays, Loops. EE 3610 Digital Systems
EE 3610: Digital Systems 1 Lecture 5: State Machines, Arrays, Loops BCD to Excess-3 (XS 3 ) Code Converter Example: Fig. 2-53 2 Easier to use one type of code (e.g. XS 3 ) over the other type (e.g. BCD)
More informationRegisters. Instruction Memory A L U. Data Memory C O N T R O L M U X A D D A D D. Sh L 2 M U X. Sign Ext M U X ALU CTL INSTRUCTION FETCH
PC Instruction Memory 4 M U X Registers Sign Ext M U X Sh L 2 Data Memory M U X C O T R O L ALU CTL ISTRUCTIO FETCH ISTR DECODE REG FETCH EXECUTE/ ADDRESS CALC MEMOR ACCESS WRITE BACK A D D A D D A L U
More informationENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices
ENGG3380: Computer Organization and Design Lab4: Buses and Peripheral Devices School of Engineering, University of Guelph Winter 2017 1 Objectives: The purpose of this lab is : Learn basic bus design techniques.
More informationCaches. Hiding Memory Access Times
Caches Hiding Memory Access Times PC Instruction Memory 4 M U X Registers Sign Ext M U X Sh L 2 Data Memory M U X C O N T R O L ALU CTL INSTRUCTION FETCH INSTR DECODE REG FETCH EXECUTE/ ADDRESS CALC MEMORY
More informationVHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents
VHDL Testbench Tutorial 1 Contents 1 VHDL Testbench 2 Test Bench Syntax 3 Testbench Example: VHDL Code for Up Down Binary Counter 4 VHDL Testbench code for up down binary counter 5 Testbench Waveform for
More informationCOE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14
COE 405, Term 062 Design & Modeling of Digital Systems HW# 1 Solution Due date: Wednesday, March. 14 Q.1. Consider the 4-bit carry-look-ahead adder (CLA) block shown below: A 3 -A 0 B 3 -B 0 C 3 4-bit
More informationSubprograms, Packages, and Libraries
Subprograms, Packages, and Libraries Sudhakar Yalamanchili, Georgia Institute of Technology ECE 4170 (1) function rising_edge (signal clock: std_logic) return boolean is declarative region: declare variables
More informationGetting Started with the CPU Design
Getting Started with the CPU Design In this tutorial we will create a skeleton of your top-level computer and CPU. You may want to create a new library for these designs, but you may feel free to use your
More informationMCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD.
MCPU - A Minimal 8Bit CPU in a 32 Macrocell CPLD. Tim Böscke, cpldcpu@opencores.org 02/2001 - Revised 10/2004 This documents describes a successful attempt to fit a simple VHDL - CPU into a 32 macrocell
More informationLecture 12 VHDL Synthesis
CPE 487: Digital System Design Spring 2018 Lecture 12 VHDL Synthesis Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 1 What is Synthesis?
More informationControl Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN
Control Unit: Binary Multiplier Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN Example: Binary Multiplier Two versions Hardwired control Microprogrammed
More informationToday. Comments about assignment Max 1/T (skew = 0) Max clock skew? Comments about assignment 3 ASICs and Programmable logic Others courses
Today Comments about assignment 3-43 Comments about assignment 3 ASICs and Programmable logic Others courses octor Per should show up in the end of the lecture Mealy machines can not be coded in a single
More informationChapter 8 VHDL Code Examples
APPENDIX I Chapter 8 VHDL Code Examples I.1 Introduction Two example VHDL code designs are presented in Chapter 8, the first for controlling the AD7524 digital-to-analogue converter and the second for
More informationAltera s Avalon Communication Fabric
Altera s Avalon Communication Fabric Stephen A. Edwards Columbia University Spring 2012 Altera s Avalon Bus Something like PCI on a chip Described in Altera s Avalon Memory-Mapped Interface Specification
More information7 PROGRAMMING THE FPGA Simon Bevan
7 PROGRAMMING THE FPGA Simon Bevan 7.1 VHDL The FPGA chip can be programmed using a language called VHDL. VHDL is a hardware description language for describing digital designs. It originated from a government
More informationExample 58: Traffic Lights
208 Chapter 8 Listing 8.7(cont.) doorlock2_top.vhd btn012
More informationEEE8076. Reconfigurable Hardware Design (coursework) Module Outline. Dr A. Bystrov Dr. E.G. Chester. Autumn
EEE8076 Reconfigurable Hardware Design (coursework) Module Outline Dr A. Bystrov Dr. E.G. Chester Autumn 2010 1 2 3 4 5 6 7 8 9 10 11 12 Altera UP2 development board, Flex EPF10K70 FPGA www.altera.com/literature/univ/upds.pdf
More informationECE 341 Final Exam Solution
ECE 341 Final Exam Solution Time allowed: 110 minutes Total Points: 100 Points Scored: Name: Problem No. 1 (10 points) For each of the following statements, indicate whether the statement is TRUE or FALSE.
More informationThe University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004
The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2004 1. (15 points) An old Thunderbird car has three left and three right tail lights, which flash in unique
More informationEENG 2910 Project III: Digital System Design. Due: 04/30/2014. Team Members: University of North Texas Department of Electrical Engineering
EENG 2910 Project III: Digital System Design Due: 04/30/2014 Team Members: University of North Texas Department of Electrical Engineering Table of Content i Contents Abstract...3 Introduction...3 Report...4
More informationECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles
ECE 448 Lecture 4 Sequential-Circuit Building Blocks Mixing Description Styles George Mason University Reading Required P. Chu, FPGA Prototyping by VHDL Examples Chapter 4, Regular Sequential Circuit Recommended
More informationPart 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits
M1 Informatique / MOSIG Introduction to Modeling and erification of Digital Systems Part 4: HDL for sequential circuits Laurence PIERRE http://users-tima.imag.fr/amfors/lpierre/m1arc 2017/2018 81 Sequential
More informationDIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6
DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines Algorithmic State Machine (ASM) charts FINITE STATE MACHINES (FSMs) Classification: Moore Machine:
More informationVHDL simulation and synthesis
VHDL simulation and synthesis How we treat VHDL in this course You will not become an expert in VHDL after taking this course The goal is that you should learn how VHDL can be used for simulation and synthesis
More informationSign here to give permission for your test to be returned in class, where others might see your score:
EEL 4712 Midterm 2 Spring 215 VERSION 1 Name: UFID: Sign here to give permission for your test to be returned in class, where others might see your score: IMPORTANT: Please be neat and write (or draw)
More informationCprE 583 Reconfigurable Computing
Recap Moore FSM Example CprE / ComS 583 Reconfigurable Computing Moore FSM that recognizes sequence 10 0 1 0 1 S0 / 0 S1 / 0 1 S2 / 1 Prof. Joseph Zambreno Department of Electrical and Computer Engineering
More informationLuleå University of Technology Kurskod SMD152 Datum Skrivtid
Luleå University of Technology Kurskod SMD152 Datum 2003-10-24 Skrivtid 9.00 13.00 1 Manual synthesis (10 p, 2 p each) Here you are given five different VHDL models. Your task is to draw the schematics
More informationVHDL for Modeling - Module 10
VHDL for Modeling Module 10 Jim Duckworth, WPI 1 Overview General examples AND model Flip-flop model SRAM Model Generics DDR SDRAM Model Constraints Metastability Block Statements Just for reference Jim
More informationSynthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden
Synthesis from VHDL Krzysztof Kuchcinski Krzysztof.Kuchcinski@cs.lth.se Department of Computer Science Lund Institute of Technology Sweden March 23, 2006 Kris Kuchcinski (LTH) Synthesis from VHDL March
More informationEECE 353: Digital Systems Design Lecture 10: Datapath Circuits
EECE 353: Digital Systems Design Lecture 10: Datapath Circuits Cristian Grecu grecuc@ece.ubc.ca Course web site: http://courses.ece.ubc.ca/353 Introduction to lecture 10 Large digital systems are more
More information[VARIABLE declaration] BEGIN. sequential statements
PROCESS statement (contains sequential statements) Simple signal assignment statement
More informationENGR 2031 Digital Design Laboratory Lab 7 Background
ENGR 2031 Digital Design Laboratory Lab 7 Background What we will cover Overview of the Simple Computer (scomp) Architecture Register Flow Diagrams VHDL Implementation of scomp Lab 7 scomp Architecture
More informationChapter Seven. Memories: Review. Exploiting Memory Hierarchy CACHE MEMORY AND VIRTUAL MEMORY
Chapter Seven CACHE MEMORY AND VIRTUAL MEMORY 1 Memories: Review SRAM: value is stored on a pair of inverting gates very fast but takes up more space than DRAM (4 to 6 transistors) DRAM: value is stored
More informationCCE 3202 Advanced Digital System Design
CCE 3202 Advanced Digital System Design Lab Exercise #2 Introduction You will use Xilinx Webpack v9.1 to allow the synthesis and creation of VHDLbased designs. This lab will outline the steps necessary
More informationContents. Chapter 9 Datapaths Page 1 of 28
Chapter 9 Datapaths Page of 2 Contents Contents... 9 Datapaths... 2 9. General Datapath... 3 9.2 Using a General Datapath... 5 9.3 Timing Issues... 7 9.4 A More Complex General Datapath... 9 9.5 VHDL for
More informationConcurrent & Sequential Stmts. (Review)
VHDL Introduction, Part II Figures in this lecture are from: Rapid Prototyping of Digital Systems, Second Edition James O. Hamblen & Michael D. Furman, Kluwer Academic Publishers, 2001, ISBN 0-7923-7439-
More informationDESCRIPTION OF DIGITAL CIRCUITS USING VHDL
DESCRIPTION OF DIGITAL CIRCUITS USING VHDL Combinatinal circuits Sequential circuits Design organization. Generic design Iterative operations Authors: Luis Entrena Arrontes, Celia López, Mario García,
More informationSEQUENTIAL STATEMENTS
SEQUENTIAL STATEMENTS Sequential Statements Allow to describe the behavior of a circuit as a sequence of related events Can be used to model, simulate and synthesize: Combinational logic circuits Sequential
More informationDIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6
DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6 FINITE STATE MACHINES (FSMs) Moore Machines Mealy Machines FINITE STATE MACHINES (FSMs) Classification: Moore Machine: Outputs depend only on the current state
More informationSign here to give permission to return your test in class, where other students might see your score:
EEL 4712 Midterm 1 Spring 2017 VERSION 1 Name: UFID: Sign here to give permission to return your test in class, where other students might see your score: IMPORTANT: Please be neat and write (or draw)
More informationThe Virtex FPGA and Introduction to design techniques
The Virtex FPGA and Introduction to design techniques SM098 Computation Structures Lecture 6 Simple Programmable Logic evices Programmable Array Logic (PAL) AN-OR arrays are common blocks in SPL and CPL
More informationELCT 501: Digital System Design
ELCT 501: Digital System Lecture 4: CAD tools (Continued) Dr. Mohamed Abd El Ghany, Basic VHDL Concept Via an Example Problem: write VHDL code for 1-bit adder 4-bit adder 2 1-bit adder Inputs: A (1 bit)
More informationThe block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:
Experiment-3: Write VHDL programs for the following circuits, check the wave forms and the hardware generated a. multiplexer b. De-Multiplexer Objective: i. To learn the VHDL coding for Multiplexer and
More informationA Cache Hierarchy in a Computer System
A Cache Hierarchy in a Computer System Ideally one would desire an indefinitely large memory capacity such that any particular... word would be immediately available... We are... forced to recognize the
More information8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.
8-1 Name Binary code IDLE 000 Register operation or output R 0 RUN 0 1 Condition (a) State box (b) Example of state box (c) Decision box IDLE R 0 From decision box 0 1 START Register operation or output
More informationFPGAs in a Nutshell - Introduction to Embedded Systems-
FPGAs in a Nutshell - Introduction to Embedded Systems- Dipl.- Ing. Falk Salewski Lehrstuhl Informatik RWTH Aachen salewski@informatik.rwth-aachen.de Winter term 6/7 Contents History FPGA architecture
More informationECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University
ECE 545 Lecture 6 Behavioral Modeling of Sequential-Circuit Building Blocks George Mason University Required reading P. Chu, RTL Hardware Design using VHDL Chapter 5.1, VHDL Process Chapter 8, Sequential
More informationTiming in synchronous systems
BO 1 esign of sequential logic Outline Timing in synchronous networks Synchronous processes in VHL VHL-code that introduces latches andf flip-flops Initialization of registers Mealy- and Moore machines
More informationCOVER SHEET: Total: Regrade Info: 7 (6 points) 2 (14 points) 4 (12 points) 8 (20 points) 9 (24 points) 10 (5 extra credit points)
EEL 4712 Midterm 3 Spring 2011 VERSION 1 Name: UFID: Sign your name here if you would like for your test to be returned in class: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read
More informationThe University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006
The University of Alabama in Huntsville ECE Department CPE 526 01 Midterm Exam Solution March 2, 2006 1. (15 points) A barrel shifter is a shift register in which the data can be shifted either by one
More informationLab 3. Advanced VHDL
Lab 3 Advanced VHDL Lab 3 Advanced VHDL This lab will demonstrate many advanced VHDL techniques and how they can be used to your advantage to create efficient VHDL code. Topics include operator balancing,
More informationNanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas
Nanosistemų programavimo kalbos 5 paskaita Sekvencinių schemų projektavimas Terminai Combinational circuit kombinacinė schema (be atminties elementų) Sequential circuit nuosekli (trigerinė, sekvencinė)
More informationCaches and Memory Hierarchy: Review. UCSB CS240A, Winter 2016
Caches and Memory Hierarchy: Review UCSB CS240A, Winter 2016 1 Motivation Most applications in a single processor runs at only 10-20% of the processor peak Most of the single processor performance loss
More informationVHDL Examples Mohamed Zaky
VHDL Examples By Mohamed Zaky (mz_rasmy@yahoo.co.uk) 1 Half Adder The Half Adder simply adds 2 input bits, to produce a sum & carry output. Here we want to add A + B to produce Sum (S) and carry (C). A
More informationDigital Systems Design
Digital Systems Design Review of Combinatorial Circuit Building Blocks: VHDL for Combinational Circuits Dr. D. J. Jackson Lecture 2-1 Introduction to VHDL Designer writes a logic circuit description in
More informationECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers
ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts Required reading P. Chu, using VHDL Chapter 1, Finite State Machine: Principle & Practice Chapter
More informationCCE 3202 Advanced Digital System Design
CCE 3202 Advanced Digital System Design Lab Exercise #2 This lab exercise will show you how to create, synthesize, and test a 3-bit ripple counter. A ripple counter is simply a circuit that outputs the
More informationECE 459/559 Secure & Trustworthy Computer Hardware Design
ECE 459/559 Secure & Trustworthy Computer Hardware Design VHDL Overview Garrett S. Rose Spring 2016 Recap Public Key Encryption (PKE) RSA (Rivest, Shamir and Adelman) Encryption Advanced Encryption Standard
More informationDesign Problem 4 Solution
CSE 260 Digital Computers: Organization and Logical Design Design Problem 4 Solution Jon Turner Due 4/13/06 1. (125 points). In this problem, you will design a packet FIFO, which is a circuit that temporarily
More informationCpE 442. Memory System
CpE 442 Memory System CPE 442 memory.1 Outline of Today s Lecture Recap and Introduction (5 minutes) Memory System: the BIG Picture? (15 minutes) Memory Technology: SRAM and Register File (25 minutes)
More informationENGG3380: Computer Organization and Design Lab5: Microprogrammed Control
ENGG330: Computer Organization and Design Lab5: Microprogrammed Control School of Engineering, University of Guelph Winter 201 1 Objectives: The objectives of this lab are to: Start Date: Week #5 201 Due
More informationECOM 4311 Digital Systems Design
ECOM 4311 Digital Systems Design Eng. Monther Abusultan Computer Engineering Dept. Islamic University of Gaza Page 1 Agenda 1. Counters Page 2 Counters - special name of any clocked sequential circuit
More informationProgrammable Logic. Simple Programmable Logic Devices
Programmable Logic SM098 Computation Structures - Programmable Logic Simple Programmable Logic evices Programmable Array Logic (PAL) AN-OR arrays are common blocks in SPL and CPL architectures Implements
More information