# Basic Logic Circuits

## Contents

# Basic Logic Circuits#

## Learning Goals#

be comfortable in creating new projects in Vivado

be able to derive logic functions from truth tables

be able to define sum of products (SOP) and product of sums (POS) logic functions in Verilog

be able to translate a worded problem description into Verilog

## Background#

### Overview of the Design Process#

Source: Overview of the Design Process

#### A High Level View of the Design Process#

You are asked to engineer an entertainment system for a student room that should have the following functions:

if the emergency button is pressed:

the motor should unroll the window curtain

the spotlight targeting the disco ball is activated

if humidity is too high:

the window opening motor is activated

if the back-to-normal button is pressed:

…

How is the compilation of the above functions called?

Solution to Exercise 36

Compiling together the required functions of system in a functional requirements document is a typical component of a system design process.

A functional requirement defines a behavior between the inputs and outputs of a system.

Name methods for describing the required functions of a logic system?

Solution to Exercise 37

Block diagram for an overview

Schematic, focuses in details in contrast to a block diagram.

Boolean function \(f:\{0,1\}^{k}\to \{0,1\}\) represented by:

using an HDL

We can describe a digital circuit using various methods. How many of these are behavioral descriptions?

Block diagram

Schematic

Boolean function

Truth table

A) 0 B) 1 C) 2 D) 3 E) I don’t know

Solution to Exercise 38

In the choices everything but the schematic (circuit diagram) of a digital circuit describes its functions and thus behavior. A schematic of a circuit consists of interconnected logic gates which is a pure structural description and does not convey any direct functional information for the untrained eye.

#### The Design Process#

What are the typical steps of designing a digital circuit?

Solution to Exercise 39

Requirements

functional requirements which answer the question

*What should the design do?*non-functional requirements

*How a system supposed to be?*, e.g., performance, security, reliability, testability (also called*ilities*)

Design capture, e.g., schematic capture, which can comprise of^hdl_designer:

state diagram

block diagram

flow chart

truth table

Making sure to meet both functional and non-functional requirements.

Implementation using synthesis of, e.g.:

HDL

generated code

Note that nowadays step 2. and 3. are intertwined because the tools

Verification can be done after various stages:

behavioral level

logic gate level (after synthesis)

after mapping (using device-specific primitives)

after routing (including interconnect latencies)

on device

### Representations of Logic Operations#

Source: Representations of Logic Operations

Using which Boolean operator/s can we construct every logical function?

Solution to Exercise 40

and

or

not

Exclusive or, abbreviated as `XOR`

is one of the Boolean operators.

What does it mean?

Describe it using:

`AND`

,`OR`

,`NOT`

Solution to Exercise 41

The output is true if and only if one of the two inputs is (

*exclusively*) true(i1 AND not i2) OR (not i1 AND i2)

#### SOP and POS Circuits#

What are *sum of products* and *products of sums* good for?

Solution to Exercise 42

POS and SOP are two ways of describing logical functions using the inputs of the logical function.

For example they allow us to express every logical function in a *canonical normal form*.

There are two forms:

*disjunctive*– the canonical disjunctive normal form (CDNF), which uses*maxterm*s chained by`OR`

s.*conjunctive*– the c. conjunctive n. f. (CCNF), which uses*minterm*s chained by`AND`

s.

CDNF is in SOP form and CCNF in POS.

What does *product* and *sum* mean in product of sums and sum of products?

Solution to Exercise 43

Because `AND`

and `OR`

are depicted using a multiplication (`.`

, `*`

) and addition symbol (`+`

), respectively1

Imagine that you have a truth table with many inputs and a single output.

On which rows of the truth table would you focus if you want to derive the logical function in CDNF?

Why do we focus on these rows?

Solution to Exercise 44

Rows where the output is

`True`

.CDNF contains the conditions (

`AND`

-chained input conditions) which individually cause the output to be`True`

. These conditions are connected together with an`OR`

, because any of the conditions lead to a`True`

output. We do not involve the conditions with the output`False`

, because they cannot effect the result of an`OR`

-chain.

#### Logic Functions#

A total of 16 logic functions are possible if we have two binary inputs a single binary output.

Why?

Solution to Exercise 45

With two binary inputs there are four different conditions. A logical function maps every condition to a binary output. Consequently, we have \(2^4\) different outcomes describing the four different conditions of a logical function.

How many logic functions are possible if we have three inputs and a single output?

Solution to Exercise 46

With three inputs we have eight different conditions and each condition leads to a binary output.

We can have \(2^8\) different functions.

#### Minterms and Maxterms#

We already mentioned the terms

maxterm

product of sums

A sum is a logical expression of some Boolean variables chained by `OR`

s.

What is the difference between a maxterm and a sum?

Solution to Exercise 47

A maxterm contains all input variables of a logical function. A sum does not necessarily contains all the input variables.

Note that the canonical conjunctive normal form is derived from a truth table and contains all possible inputs. CCNF is also called *maxterm canonical form*

### Electric and Electronic Switches for Logic Circuits#

Source: Electric and Electronic Switches for Logic Circuits

#### Switching Circuits#

#### Semiconductor-based Electronic Switches#

Where does the name transistor come from?

Solution to Exercise 48

It seems to be a combination of *transfer* and *resistor*2.

And why does a transistor transfer a resistor? A transistor can be used both as a switch (that is how we typically use it digital design) or in general as an amplifier. If we apply a constant voltage between the gate and source of a field-effect transistor, then we get a constant current flowing through source and drain regardless of the voltage between source and drain. If we increase the voltage between gate and source, the current through source and drain also changes. From the user perspective the device seems to transfer a resistor to its output. That is where the name probably comes from.

Another observation: If we model a transistor as a two-port network we have a transfer resistor value of $\frac{V_2}(I_1}.

More information:

### Introduction to CMOS Technology#

Source: Introduction to CMOS Technology