Professional Documents
Culture Documents
Talha MP Lab 04
Talha MP Lab 04
Talha MP Lab 04
SUBJECT: MP AND MC
LAB NO : 04
Develop a C program for showing outputs of multiplication division subtraction and addition at
PORTC of ATMega 16 by providing input signal at PORTB and PORTD.
SO WE HAVE A CODE
DDRC=0xff;
PORTC=0x00;
While (1)
}
PROGRAM 1 :
For division: For Multiplication:
OUTPUT 2:
FOR DIVISION:
FOR ADDITION:
FOR SUBTRACTION:
PROGRAM 2:
CODE FOR (A+B+C)2:
OUTPUT 2:
CODE FOR A2+B2+ B2+2AB+2BC+2AC :
PROGRAM 3:
OUTPUT 3:
(THE END)