Tiling
Tiling
PROJECT 2
RECURSIVE COMBINATIONAL CIRCUITS
Instructions
(1) The project must be implemented and submitted individually.
(2) Submissions in pairs or groups are not allowed. Plagiarism will not
be tolerated.
(3) Submit exactly 1 Logisim (“.circ”) file under the appropriate submis-
sion box on Moodle.
The file must be named ID tiling.circ, with ID replaced by your
9 digit ID number.
(4) Use the provided template tiling.circ file as a template, and
implement your designs in the respective circuits. Do not move or
modify the input/output ports, the “blackbox” layout, and the names
of the circuits!
(5) If you need to use a constant 0 or 1 as a component in your circuits,
use the “Constant” component from the “Wiring” library.
(6) Use tunnels to keep your circuit clean and free of spaghetti wiring.
Do not remove the tunnels provided in the template. Use tunnels
with matching names to connect the inputs/outputs to your circuit.
Note: There is no limit on the number of tunnels corresponding to a
signal. As long as they have the same name, any number of tunnels
can be used for a single signal.
(7) All submissions will be graded using an automated grading system.
There will be no manual grading, and the grade you receive will be
based exclusively on the functionality of your circuits. No credit will
be given purely for “attempted” solutions.
(8) In order to ensure that your file is compatible with the automated
grading system, and to get a preliminary evaluation of the functional-
ity, you are provided access to a validation system. In order to use this
validation system, you need to send an email to [email protected]
with your Logisim (“.circ”) file attached.
(9) If your file contains compatibility issues and/or errors, the validation
system will send you a reply with a list of error which you need to
fix.
(10) If your file contains no compatibility issues and errors, the validation
system will run a small number of tests on your circuits, and will
return the percentage of correct outputs observed. Note that this
∗This file may be updated once the project has been released, in order to fix mistakes
and add clarifications. It is recommended to always download and use the latest file.
1
DLS: PROJECT 2 2
†The fan-in of a gate g is the number of input terminals of g, i.e., the number of bits
in the domain of the Boolean function that specifies the functionality of g.
‡
Basic gates include not, and, or, nand, nor, xor, and nxor. Parity gates, controlled
buffers, and controlled inverters do not fall under basic gates.
DLS: PROJECT 2 3
1. Outline
This project deals with recursive implementations of combinational circuits.
The functionality of the circuit is inspired by a field of mathematics which
deals with covering planar regions using identically shaped tiles, without
gaps or overlaps. Section 3 provides a brief introduction to the problem of
tiling a chessboard with one “hole”, i.e. with one square removed, using
L-shaped tiles. Section 4 describes a recursive approach which can be used
to perform such a tiling, and explains how this approach can be implemented
using combinational circuits.
In implementing the circuits, you will be required to use basic logic
gates, multiplexers, encoders, and optionally, decoders. In addition, you will
be required to use Logisim’s “Adder” component for performing addition
between integers represented by binary strings. Note that in order to complete
the project, you do not need to implement this adder, nor know how it works
internally. Adders will be formally covered in class in the coming weeks.
Section 2 provides a brief overview of how Logisim’s adders can be used in
the context of this project.
Note that you do not need to fully understand the internal workings of
the adder in order to use it; you only need to use the input and output ports
of the adder. However, if necessary, you may assume that the adder is a
ripple carry adder. The adder has a single property called “Data Bits” which
corresponds to n in Definition 1. The adder has five I/O ports: two on the
left edge, one on the right edge, one on the top edge, and one on the bottom
edge. These ports correspond to A, B, S, C[0], and C[n], respectively. In
the context of this project, you can entirely ignore the ports on the top and
bottom edges, feed the two multi-bit inputs into the ports on the left edge,
and use the signal from the port on the right edge as the output. Figure 1
shows an example of how the adder can be used, with red arrows pointing to
the input ports, and a green arrow pointing to the output port.
DLS: PROJECT 2 4
Note that you may need to extend the width of a signal in order for it
to be compatible with the adder. For example, if you have a signal A[1 : 0]
which serves as an input to an adder with output S[3 : 0], you need to extend
A[1 : 0] to A[3 : 0] by adding two zeros to the left of A[1 : 0]. This can be
done using instances of “Splitter” and “Constant” from the “Wiring” library,
or using instances of “Bit Extender” from the “Wiring” library. If you use
bit extenders, ensure that the extension type is set to “Zero”.
3. Tiling
Consider a 2 × 2 chessboard with squares numbered as shown in Fig. 2.
0 1
2 3
(d) (e)
Hint: How is h, the position of the quadrant with the missing square, related
to the orientation of the central L-shaped tile?
addition, you may use any components permitted by the instructions at the
beginning of this document. Work along the following lines:
(1) Identify whether the chessboard represented by M contains a missing
square. If it does not, use quadrant num to determine which corner
of M is the closest to the centre of Mf, and set the corresponding
element of M to be 0. Note that this is equivalent to placing one
central L-shaped tile on the chessboard represented by M f.
(2) Implement the recursive base case for k = 1, i.e. for a 2×2 chessboard.
(3) If k > 1, divide M into four quadrants, M (0) , M (1), M (2) , and M (3) .
(4) For each quadrant, use an instance of tiling n/2 to compute the
number of L-shaped tiles of each orientation required to tile the
quadrant.
(5) Using the fully tiled outputs of the four instances of tiling n/2 ,
determine which quadrant contains the missing square. Based on
this, determine what is the required orientation of the central L-
shaped tile for the chessboard represented by M .
(6) Compute the total number of tiles of each orientation required to tile
the chessboard represented by M , taking into consideration the tiles
required to tile the quadrants, and the central L-shaped tile. Use
the “Adder” component from Logisim’s “Arithmetic” library for this
computation.
5. Exercises
Exercise 1. (1 point)
Using your design from Preliminary Task 4, complete the circuit tiling 2
from the provided template to implement the base case tiling(2). You may
use the LED matrices provided in the template as debugging tools in your
implementation.
Exercise 2. (1 point)
Using your design from Preliminary Task 4, complete the circuit tiling 4
from the provided template to implement tiling(4). You may use the LED
matrix provided in the template as a debugging tool in your implementation.
Exercise 3. (1 point)
Using your design from Preliminary Task 4, complete the circuit tiling 8
from the provided template to implement tiling(8). You may use the LED
matrix provided in the template as a debugging tool in your implementation.