3.2 STEP 2: Extending the Multiplexer

3.2.1 Synopsis

As the module will be used to multiplex single digit values later on, the bus widths need to be adjusted. This is easily done by specifying a range for all data signals which are of type integer.

Additionally, error conditions shall also be signaled to the user via the camera display. Therefore, an additional control input named ERROR is needed. The following figure shows the updated schematic:

 

The enhanced multiplexer

 

3.2.2 Implementation

Modified DISP_MUX module


library ieee;
use ieee.std_logic_1164.all;

entity DISP_MUX is
  port(EXP_TIME : in  integer
                            range 0 to 10;
       NO_PICS : in  integer
                            range 0 to 10;
       SHOW_TIME   : in  std_ulogic;
       ERROR       : in  std_ulogic;
       DISP_PHOTO : out integer
                           range 0 to 10);
end DISP_MUX;

architecture RTL of DISP_MUX is
begin
  process (SHOW_TIME, NO_PICS, EXP_TIME,
           ERROR)
  begin
    if SHOW = '0' then
      DISP_PHOTO <= NO_PICS;
    else
      DISP_PHOTO <= EXP_TIME;
    end if;

    if ERROR = '1' then
      DISP_PHOTO <= 10;
    end if;
  end process;
end RTL;


 
  • Data signals restricted to 4 bit (0-10).

 
  • New ERROR-signal.


 
  • The ERROR-signal is read during
    process execution, i.e. it must be
    added to the sensitivity list.



 
  • As the ERROR-signal is checked
    last, all previous signal assign-
    ments will be overwritten.