Data Objects and Data types

Updated on 2017/07/29 16:59

Write introduction of the Article here.

Data Objects


The signal represents interconnection wires between ports it may be declared in the declaration part of

  • packages
  • entities
  • architectures
  • blocks


signal signal_name : signal_type;
Signal assignment: <=


The variable locally stores temporary data and it is used only inside a sequential statement that means

  • process
  • function
  • procedures

The variable is visible only inside processes and subprograms in which it is declared. The variable declaration is


variable variable_name : variable_type;
Variable assignment: :=


The constant names specific values to make the model better documented and easy to update.

The constant can be declared in all the declarative VHDL statement,

  • sequential
  • concurrent

that means it may be declared in the declaration section of packages, entities, architectures, processes, subprograms and blocks

The constant declaration is


constant constant_name : constant_type := value;


The File type is used to access File on disk.

It is used only in test bench; in fact File type cannot be implemented in hardware.

In order to use the FILE type you shall include the TextIO package that contains all procedures and functions that allow you to read from and write to formatted text files.

Input ASCII files are handled as file of lines, where a line is a string, terminated by a carriage return.

TextIO package declares a type line used to hold

  • a line read from an input file
  • a line to write to an output file

Syntax: Write file

process_write_file : process(...)
file file_name_write: text; -- declare file
variable row: line; -- line to access file
variable integer_value : integer; -- integer value write to file
-- open file write mode
file_open(file_name_read,file_to_write.txt, write_mode);
-- read line from file and then read integer value
end process process_write_file;

Syntax: Read file

process_read_file : process(...)
file file_name_read : text; -- declare file
variable row : line; -- line to access file
variable integer_value : integer; -- integer value read from file
-- open file read mode
file_open(file_name_read, file_to_read.txt, read_mode);
-- read line from file and then read integer value
end process process_read_file;

Data Types



  • Edited and Created by Prof Hrishikesh Dhanwate, JSPM'S ICOER,Wagholi ,Pune
  • WikiNote Foundation
Created by HrishikeshDhanawate on 2017/07/28 15:22