Model of the Month


We can update you automatically when this page changes.
To receive regular notification of updates to our Model of the Month section, click here.


32-bit Demultiplexer

This month’s Tip of the Month looked at the use of the others expression in expressing magic numbers. This months Model of the Month shows how the others expression can be used in modeling a common hardware function, namely a demultiplexer.

The demux_32 code relies on the use of a conversion function in order to minimize the amount of VHDL code that needs to be written; to_integer is defined in the generic_conversions package and compiled into the vfp library.

Notice also that the y output is initialized to all '0' at the start of the process, so even though there is no else branch for the if statement, incomplete assignment does not apply (and therefore you will not get latches from synthesizing this code). Speaking of synthesis, you will need to change the code to use the correct conversion function for your synthesis tool — to_integer is for simulation only.

You are welcome to use the source code we provide but you must keep the copyright notice with the code (see the Acknowledgements page for more details).


The VFP Library is required for simulating this month's Model of the Month.
To download the VFP files, click here.


-- demux_32
--
-- +-----------------------------+
-- |    Copyright 1997 DOULOS    |
-- |    Library:  multiplexer    |
-- |    designer : Tim Pagden    |
-- |     opened: 31 Oct 1997     |
-- +-----------------------------+
 
-- Architectures:
--   31.10.97 behaviour

library ieee;
library vfp;

-- behaviour
architecture behaviour of demux_32 is
  use ieee.std_logic_1164.all;
  use vfp.generic_conversions.all;

begin

  demux_a_to_y: process (a, enable)
  begin
    y <= (others => '0');
    if enable = '1' then
      y(to_integer(a)) <= '1';
    end if;
  end process;

end behaviour;

To download the VHDL source code for this month's
Model of the Month, click here.

VHDL source code for other Models of the Month
can be downloaded from here.


accumulator diagramFPGA / ASIC Design and Project Services
wand iconDoulos Training Courses


river iconDoulos Home Page

Copyright 1995-1997 Doulos
This page was last updated 31
th October 1997

mail iconWe welcome your e-mail comments. Please contact us at: webmaster@doulos.co.uk