CMSC250, Spring 2004
Homework 3 Answers
Due Wednesday, February 18 at the beginning of your discussion section.
You must write the solutions to the problems single-sided on your own lined paper,
with all sheets stapled together, and with all answers written in sequential order or you will lose points.
- Consider a digital logic circuit that works as follows. There are three inputs,
,
, and
. The output is
's
value if
is 0, and
's value if
is 1. In other words,
selects which input,
or
, to output.
- Write a logical expression that corresponds to this circuit.
- Answer:
- Draw the diagram for this circuit, using any combination of 2-input AND gates, 2-input OR gates, and 1-input NOT gates.
Note 1: A ``2-input AND gate'' simply means that the AND gates has two lines coming into it. It does not mean that you may
only use two of these gates in your circuit; you may use any number of each type of gate.
Note 2: Please label each gate in your circuit diagram to assist us in grading your work.
- Answer:
- Write a logical expression that is equivalent to your expression from part (a), but without using any OR gates.
- Answer:
- Draw the circuit diagram corresponding to your expression in part (c).
- Answer:
- Perform the following conversions and calculations. Binary numbers are represented in 8-bit 2's complement. Showing your work will assist
us in awarding partial credit.
-
-
-
-
-
- You've learned techniques for converting numbers between the binary, octal, and hexadecimal number systems. A quick review (from textbook pages 72-73):
- To convert an integer from hexadecimal to binary, write each hexadecimal digit of the integer in fixed 4-bit binary notation. Combine the resulting bits, end to end.
- To convert an integer from binary to hexadecimal, group the bits into sets of four, starting from the right and adding leading zeros as needed. Convert the binary numbers in each set of four into hexadecimal digits, and string all the digits together.
The procedures for octal are identical, but instead of making groups of four bits, make groups of three bits.
In the future, astronauts land on the planet Quatrella in a far away galaxy. The inhabitants of Quatrella use a base-4 number system.
- The decimal system uses the digits 0-9. What are the digits in the base-4 system?
- How would you modify the conversion procedures above to convert integers in binary to and from the base-4 system?
- Answer: Instead of grouping by four bits (hexadecimal) or three bits (octal), group in two bits.
For example:
- To prepare for future encounters in outer space, the astronauts would like to know how to convert binary integers to and from
any base that is a power of two; that is, any base in the form
for some integer
. Describe procedures to
accomplish this.
- Answer: Follow the regular procedures above, but group bits into sizes of
, for a number system in base
. In
other words, if you have a base-32 number system, group the bits in fives, since
.
- In each part below, you are given a statement, a domain, and one or more predicates. Translate the statement into
symbolic logic using only those predicates and sets defined in that part.
- ``All cows eat grass.'' Domain:
{cows}. Predicates:
eats grass.
- Answer:
- ``All cows eat grass.'' Domain:
universal set. Predicates:
eats grass;
is a cow.
- Answer:
- ``Some teachers are also students.'' Domain:
{teachers}. Predicates:
is a student.
- Answer:
- ``Some teachers are also students.'' Domain:
universal set. Predicates:
is a student;
is a teacher.
- Answer:
- Let
and
be predicates and
be the domain of
. Justify each of your answers in English.
- Are ``
'' and
``
'' equivalent statements?
- Answer: Yes. A universal statement can be thought of a generalization of an and statement. If
the domain
is
, then
is logically equivalent to
which, by commutativity, is logically equivalent to
- Are ``
'' and
``
'' equivalent statements?
- Let
mean ``person
enjoys sport
,'' and let
{people} and
{sports}.
For each of the following statements, re-write each one formally using symbolic logic.
- Everyone has some sport that they enjoy.
- Answer:
- There is someone who doesn't enjoy any sports.
- Answer:
- Every sport is enjoyed by someone (possibly a different someone for each sport).
- Answer:
- There is a sport that nobody enjoys.
- Answer:
- Define a predicate
to satisfy these conditions:
``
'' is true, but
``
'' is false.
You do not need to justify your answer.
- Answer: There are many predicates that work. For example, let
mean ``
.'' This works because
for any integer
, there is always another integer
that is greater (the first condition), but it is
not true that there is some integer
that is greater than all integers
(the second condition).
This document was generated using the
LaTeX2HTML translator Version 2002 (1.62)
Copyright © 1993, 1994, 1995, 1996,
Nikos Drakos,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Ross Moore,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 -nonavigation -antialias_text -antialias hw3ans
The translation was initiated by Phillip Kirlin on 2004-02-18
Phillip Kirlin
2004-02-18
Web Accessibility