Conditional operator – Altera Nios II C2H Compiler User Manual

Page 48

Advertising
background image

3–8

9.1

Altera Corporation

Nios II C2H Compiler User Guide

November 2009

One-to-One C-to-Hardware Mapping

Figure 3–5. if Logic Without else

Conditional Operator ?:

The

?:

(conditional) operator is functionally equivalent to the

if-else

statement, but the placement of registers is different. The condition logic
and selection logic compute in the same clock cycle, and the result is
registered.

Advertising