0% found this document useful (0 votes)
6 views4 pages

truth_tables_arrays_homework

The document is a homework assignment focused on Boolean logic and truth tables, requiring students to fill in missing values for various Boolean expressions using AND, OR, and NOT operators. It includes sections on basic Boolean operators, combining operators, and more complex expressions, as well as a programming task to print a 2D array in matrix format. Students are instructed to populate truth tables with binary counts and complete programming tasks in Python or Java.

Uploaded by

Ridm D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

truth_tables_arrays_homework

The document is a homework assignment focused on Boolean logic and truth tables, requiring students to fill in missing values for various Boolean expressions using AND, OR, and NOT operators. It includes sections on basic Boolean operators, combining operators, and more complex expressions, as well as a programming task to print a 2D array in matrix format. Students are instructed to populate truth tables with binary counts and complete programming tasks in Python or Java.

Uploaded by

Ridm D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Boolean Logic & Truth Tables - Homework Assignment

Instructions: Complete the missing values in the truth tables below using AND, OR, and NOT
operators.

Hint: he inputs column should be populated in a binary count up


Hint: There should be 2^(n) number of inputs

Section 1: Basic Boolean Operators


1. Fill in the truth tables for the following Boolean expressions:

a) A AND B

A B A AND B

? ? ?

? ? ?

? ? ?

? ? ?

b) A OR B

A B A OR B

? ? ?

? ? ?

? ? ?

? ? ?

c) NOT A

A NOT A

? ?

? ?
Section 2: Combining Boolean Operators
2. Complete the truth tables for each Boolean expression below.

a) (A AND B) OR C

A B C A AND B (A AND B) OR C

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

? ? ? ? ?

b) (A OR B) AND (NOT C)

A B C A OR B NOT C (A OR B) AND (NOT C)

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

Section 3: More Complex Boolean Expressions


3. Complete the truth tables for the following expressions.
a) NOT (A AND B) OR C

A B C A AND B NOT (A AND B) NOT (A AND B) OR C

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

? ? ? ? ? ?

b) (A OR NOT B) AND (B OR C)

A B C NOT B A OR NOT B B OR C (A OR NOT B) AND (B OR C)

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

? ? ? ? ? ? ?

Section 4: Generalised array printer


4. Create a function take any array as input and print it.

✏️ Write a Python or Java program to complete the following tasks.


a) Print a 2D Array in Matrix Format
i) Write a program that prints the following 2D array as a matrix:
ii) create a function printArray(array) that takes in any 2D array and prints it in a matrix format
Given array:

1 2 3
4 5 6
7 8 9

Expected Output:

1 2 3
4 5 6
7 8 9

You might also like