You are on page 1of 5

Islamic University of Gaza

Engineering Faculty

Computer Engineering Department

Discrete Mathematics

Logic operator and counting systems


2

Overview

- Tasks

- Task 1

- Task 2

- Homework
3

Tasks

Task 1

Write a program to print the truth table of the logic operators: AND, OR, XOR,
INVERSE, IMPLICATION, and BICONDITIONAL.

Your output should be similar to Figure 1.

Figure 1: Truth table output


4

Task 2

Write a program to convert between counting systems: binary, octave, decimal, and
hexadecimal.

Your output should be similar to Figure 2.

Figure 2: Convert output


5

Homework
● Write a program to add, subtract, multiply, and divide (with remainder) two
binary numbers.
● Bonus: Write a program to print the GCD (i.e., the greatest common divisor) of
two numbers (use prime factorization, modulus, and Euclid's Algorithms).

You might also like