# Vhdl Assignment Operators Php

- < Programmable Logic/VHDL

**Programmable Logic**

This page is going to discuss VHDL Operators.

Some abbreviations used in this text:

**int**- integer, a data type**sl**- std_logic, a data type (in most cases replacable with*bit*)**slv**- std_logic_vector, a data type (in most cases replacable with*bit_vector*)**slu**- std_logic_unsigned - a part of library ieee.**sls**- std_logic_signed - a part of library ieee.**iff**- "if and only if"

## Logical Operators[edit]

This list is far from complete.

operator | examples | description |
---|---|---|

sl and sl | a_sl <= b_sl and c_sla_sl <= ieee.std_logic_1164." and"(b_sl, c_sl); | a_sl will be '1' iff both b_sl and c_sl is '1' |

slv and slv | a_slv <= b_slv and c_slva_slv <= ieee.std_logic_1164." and"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

sl or sl | a_sl <= b_sl or c_sla_sl <= ieee.std_logic_1164." or"(b_sl, c_sl); | a_sl will be '1' iff at least one of b_sl and c_sl is '1'. |

slv or slv | a_slv <= b_slv or c_slva_slv <= ieee.std_logic_1164." or"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

sl xor sl | a_sl <= b_sl xor c_sla_sl <= ieee.std_logic_1164." xor"(b_sl, c_sl); | a_sl will be '1' iff exactly one of b_sl and c_sl is '1'. |

slv xor slv | a_slv <= b_slv xor c_slva_slv <= ieee.std_logic_1164." xor"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

not sl | a_sl <= not b_sla_sl <= ieee.std_logic_1164." not"(b_sl); | a_sl will be inverse of b_sl, that is '1' iff b_sl = '0'. |

not slv | a_slv <= not b_slva_slv <= ieee.std_logic_1164." not"(b_slv); | Applied to each respectively bits in a_slv, b_slv. a_slv, b_slv must have equal length (e.g. 8 bits) |

sl nand sl | a_sl <= b_sl nand c_sla_sl <= ieee.std_logic_1164." nand"(b_sl, c_sl); | a_sl will be '1' iff at least one of b_sl and c_sl is '0'. Equivalent to not (sl and sl) |

slv nand slv | a_slv <= b_slv nand c_slva_slv <= ieee.std_logic_1164." nand"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

sl nor sl | a_sl <= b_sl nor c_sla_sl <= ieee.std_logic_1164." nor"(b_sl, c_sl); | a_sl will be '1' iff both b_sl and c_sl is '0'. Equivalent to not (sl or sl) |

slv nor slv | a_slv <= b_slv nor c_slva_slv <= ieee.std_logic_1164." nor"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

sl xnor sl | a_sl <= b_sl xnor c_sla_sl <= ieee.std_logic_1164." xnor"(b_sl, c_sl); | a_sl will be '1' iff both b_sl and c_sl is either '1' or '0'. Equivalent to not (sl xor sl) |

slv xnor slv | a_slv <= b_slv xnor c_slva_slv <= ieee.std_logic_1164." xnor"(b_slv, c_slv); | Applied to each respectively bits in a_slv, b_slv, c_slv. a_slv, b_slv, c_slv must have equal length (e.g. 8 bits) |

## Arithmetic Operators[edit]

## Relational Operators[edit]

## Shift and Rotate[edit]

This page or section is an undeveloped draft or outline.You can help to develop the work, or you can ask for assistance in the project room. |

## Operators[edit]

### Sign Operators[edit]

Sign operators are unary operators, i.e. have only one, right operand, which must be of a numeric type. The result of the expression evaluation is of the same type as the operand. There are two sign operators (Table 12).

Table 12 : Sign operators :

When ( + ) sign operator is used, the operand is returned unchanged, but In case of ( - ) sign operator the value of operand with the negated sign is returned. Because of the lower priority, the sign operator in the expression cannot be directly preceded by the multiplication operator, the exponentiation operator (**) or the abs and not operators. When these operators are used then sign operator and its operand should be enclosed in parentheses (Example 7).

### Multiplying Operators[edit]

The multiplication and division operators are predefined for all integers, floating point numbers. Under certain conditions, they may be used for operations on physical type objects as well. The mod and rem operators, on the other hand, are defined only for the integers. When mod and rem operators are used, then both the operands and the result are of the same integer type. The multiplying operators are shown in the Table 13.

Table 13. Multiplying operators

* | Multiplication |

/ | Division |

mod | Modulus |

rem | Remainder |

### Miscellaneous operators[edit]

The two miscellaneous operators are shown in the Table 14.

Table 14. Miscellaneous operators

** | Exponentiation |

abs | Absolute value |

The abs operator has only one operand. It allows defining the operand's absolute value. The result is of the same type as the operand. The exponentiation operator has two operands. This operator is defined for any integer or floating point number. The right operand (exponent) must be of integer type. When the exponent is the positive integer, then the left operand is repeatedly multiplied by itself. When the exponent is the negative number, then the result is a reverse of exponentiation with the exponent equal to the absolute value of the right operand (Example 9). If the exponent is equal to 0 the result will be 1.

### Examples[edit]

#### Example 1[edit]

The multiplication y*x is carried out first, then a is added to the result of multiplication. This is because the multiplication operator has higher level of priority than the adding operator.

#### Example 2[edit]

For the initial value of the variables We1, We2, We3 equal to '1', the result is assigned to the variable Wy and is equal to '0'.

#### Example 3[edit]

#### Example 5[edit]

#### Example 6[edit]

#### Example 7[edit]

The same expressions without parentheses would be illegal.

#### Example 8[edit]

#### Example 9[edit]

### Important Notes[edit]

- All predefined operators for standard types are declared in the package STANDARD.
- The operator not is classified as a miscellaneous operator only for the purpose of defining precedence. Otherwise, it is classified as a logical operator.

## PHP Assignment Operators

## Description

Assignment operators allow writing a value to a variable. The first operand must be a variable and the basic assignment operator is "=". The value of an assignment expression is the final value assigned to the variable. In addition to the regular assignment operator "=", several other assignment operators are composites of an operator followed by an equal sign.

Interestingly all five arithmetic operators have corresponding assignment operators, Here is the list.

The following table discussed more details of the said assignment operators.

Shorthand | Expression | Description |
---|---|---|

$a+= $b | $a = $a + $b | Adds 2 numbers and assigns the result to the first. |

$a-= $b | $a = $a -$b | Subtracts 2 numbers and assigns the result to the first. |

$a*= $b | $a = $a*$b | Multiplies 2 numbers and assigns the result to the first. |

$a/= $b | $a = $a/$b | Divides 2 numbers and assigns the result to the first. |

$a%= $b | $a = $a%$b | Computes the modulus of 2 numbers and assigns the result to the first. |

**Example: **

Output:

200 0 90000 1 0 Value of x & y is : 20 11View the example in the browser