1. Home
  2. /
  3. Vhdl
  4. /
  5. Array Sum

Array Sum - Vhdl Typing CST Test

Loading…

Array Sum — Vhdl Code

Sums elements of a fixed array.

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;

entity ArraySum is
	Port (
		sum_out : out INTEGER
	);
end ArraySum;

architecture Behavioral of ArraySum is
	type int_array is array (0 to 4) of INTEGER;
	signal nums : int_array := (1,2,3,4,5);
	signal sum : INTEGER := 0;
begin
	process(nums)
	begin
		sum <= 0;
		for i in 0 to 4 loop
		sum <= sum + nums(i);
		end loop;
	end process;

	sum_out <= sum;
end Behavioral;

Vhdl Language Guide

VHDL (VHSIC Hardware Description Language) is a strongly typed, concurrent hardware description language used to model, simulate, and synthesize digital systems such as FPGAs, ASICs, and SoCs. Designed for reliability, formal precision, and hardware-level abstraction.

Primary Use Cases

  • ▸FPGA design and development
  • ▸ASIC/SoC prototyping
  • ▸Digital logic design (counters, FSMs, datapaths)
  • ▸High-reliability hardware (military/aerospace)
  • ▸Hardware verification and simulation

Notable Features

  • ▸Strong static typing
  • ▸Concurrency built into the language
  • ▸Timing-accurate simulation
  • ▸Synthesizable constructs for hardware generation
  • ▸Package- and library-based modularity

Origin & Creator

Developed in the early 1980s by the U.S. Department of Defense (DoD) under the VHSIC program; standardized as IEEE 1076.

Industrial Note

You’ll find VHDL embedded in aerospace avionics, defense-grade chips, satellite systems, telecom switching, and radiation-hardened FPGA applications.

More Vhdl Typing Exercises

VHDL Counter and Theme ToggleVHDL Simple AdditionVHDL FactorialVHDL Fibonacci SequenceVHDL Max of Two NumbersVHDL Even Numbers FilterVHDL String ConcatenationVHDL Conditional Counter IncrementVHDL Conditional Counter Increment

Practice Other Languages

CReactPythonC++RustTypeScriptKotlinPHPJavaC#RubyMqlCqlN1qlCypher