Docsity

Address Decoder - Digital System Design with VHDL - Exam Solution, Exams of Digital Systems Design

Partial preview of the text

Download Address Decoder - Digital System Design with VHDL - Exam Solution and more Exams Digital Systems Design in PDF only on Docsity!

Solutions

Range 0: 0000-07FF = 0000 0XXX XXXX XXXX

Range 1: 0800-0FFF = 0000 1XXX XXXX XXXX

Range 2: 1000-17FF = 0001 0XXX XXXX XXXX Range 3: 1800-1FFF = 0001 1XXX XXXX XXXX Range 4: 2000-27FF = 0010 0XXX XXXX XXXX

  • Problem - w 15#######12##11###########8####7############4####3#############0# - w - y - y - y - En y - e - e - e - e - A - A
    • A
    • A
    • A - A - A - A - A - A - e

rst

clk

en

en

reset

8

A

A

clk

8

0 1 init

8 8

iv

addr addr

dout^ dout

S S (^44)

a07..4 a03..

4 4

b07..4 b03..

8

0 1 init

8

rst

clk

en

en

reset

8

A

clk

8 8

iv

0 1 init

8

rst

clk

en

en

reset

8

a

clk

8 8

iv

8 8

0 1 init

8

rst

clk

en

en

reset

8

a

clk

8 8

iv

init

rst

clk

en

en

reset

8

k

clk

8

8 8

ivp

1

k_fb

a0_out

<<<

b02..

3

b0^ b

  • ||^

a2 a

a2 || โ€œ11โ€

b2=p217..

p

10 18 8

b3=a

8

b2^ b

!

a1_fb

a1_fb

0 1 2 3 k1..

8 8 8 8

b0 b1 b2 b

8

a

m

read

d0 d

8 8

d0 0

d1 d

8 8 8

a3_fb

8

Problem 3 โ€“ Task 1

|| 32

yout

a0 a1 a2 a

32 8 8 8 8

s

8

b

b

b

b

ivp

8 8 8 8 8 8 8 8

a3_fb

rst

clk

en

reset

Ei

clk

zi

6

i

ld init

6

rst

clk

en

reset

Ej

clk

zj

4

j

ld init

4

rst

clk

en

reset

clk

Elb

last_block

last_block_stored

dout

addr

isprime 4

b33..

dout

addr

isprime 4

b23..

dout

addr

isprime 4

b13..

dout

addr

isprime 4

b03..

init

Optimizations:

b3 = (8*a3  6) >> 3 = = (a3 || โ€œ110โ€) >> 3 = a k = 0 || k7..1 if k 0 = 0 k = 1 || k7..1 if k 0 = 1 thus, k = k 0 || k7..1 = k >>> 1

m last_block clk^ reset src_ready

zi

zj

last_block_stored

en

en

init

read

Ei

Ej

Elb

yout

src_read done

Datapath

Controller

Problem 3 โ€“ Task 3

s

Problem 4 library ieee ; use ieee.std_logic_1164.all ; entity misr is generic (C : std_logic_vector(7 downto 0) ); port ( -- inputs clk : in std_logic; rst : in std_logic; en : in std_logic; D : in std_logic_vector (7 downto 0); -- outputs Q_out : out std_logic_vector (7 downto 0) ); end misr; architecture mixed of misr is -- intermediate signals signal Q : std_logic_vector (7 downto 0); signal Q0_replicated : std_logic_vector (7 downto 0); signal d_ff_in : std_logic_vector (7 downto 0); begin Q0_replicated <= (others => Q(0)) ; d_ff_in <= D xor ('0' & Q(7 downto 1) ) xor (C and Q0_replicated ); -- D flip flop operation D_FFs: process ( rst, clk ) begin if ( rst = '1') then Q <= (others => '0') ; elsif rising_edge(clk) then if(en = '1') then Q <= d_ff_in ; end if; end if; end process; Q_out <= Q ; end mixed;