Desain Sistem Digital: Data Tipe Dan Operator Aritmatika Eko Setiawan
Desain Sistem Digital: Data Tipe Dan Operator Aritmatika Eko Setiawan
Operator
Tipe Data
Library Aritmatika
Casting
Concenation
entity bi-demo is
port ( bi : inout std_logic ;
)
begin
sig_out <= output_expression;
Tri-state condition
process (a,b)
begin
c <= a and b;
c <= a or b;
end process;
sama dengan kode:
process (a,b)
begin
c <= a or b;
end process;
Process
If-else
Comparison
process (a,b,c,sel)
begin
case sel is
when 00 =>
r <= a + b + c;
when 10 =>
r <= a - b;
when others =>
r <= c + 1;
end case;
end process;
Sama dengan kode:
with sel select
r <= a + b + c when 00 ,
ab
when 10 ,
c+1
when others ;
Case
Tugas-2