Download as pdf or txt
Download as pdf or txt
You are on page 1of 69

Embedded Systems Design using the

MSP430FR2355 LaunchPad 2nd Edition


Brock J. Lameres
Visit to download the full and correct content document:
https://ebookmeta.com/product/embedded-systems-design-using-the-msp430fr2355-l
aunchpad-2nd-edition-brock-j-lameres/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Quick Start Guide to VHDL 2nd Edition Brock J. Lameres

https://ebookmeta.com/product/quick-start-guide-to-vhdl-2nd-
edition-brock-j-lameres/

Introduction to Logic Circuits Logic Design with


Verilog 3rd Edition Brock J. Lameres

https://ebookmeta.com/product/introduction-to-logic-circuits-
logic-design-with-verilog-3rd-edition-brock-j-lameres/

Design Principles for Embedded Systems Kcs Murti

https://ebookmeta.com/product/design-principles-for-embedded-
systems-kcs-murti/

The Engineering of Reliable Embedded Systems Michael J.


Pont

https://ebookmeta.com/product/the-engineering-of-reliable-
embedded-systems-michael-j-pont/
Embedded Microprocessor System Design using FPGAs Uwe
Meyer-Baese

https://ebookmeta.com/product/embedded-microprocessor-system-
design-using-fpgas-uwe-meyer-baese/

Embedded Systems Design Programming and Applications


1st Edition A.K. Ganguly

https://ebookmeta.com/product/embedded-systems-design-
programming-and-applications-1st-edition-a-k-ganguly/

Applied Embedded Electronics: Design Essentials for


Robust Systems Jerry Twomey

https://ebookmeta.com/product/applied-embedded-electronics-
design-essentials-for-robust-systems-jerry-twomey/

Real Time Systems Design Principles for Distributed


Embedded Applications 3rd Edition Hermann Kopetz

https://ebookmeta.com/product/real-time-systems-design-
principles-for-distributed-embedded-applications-3rd-edition-
hermann-kopetz/

Real Time Systems Design Principles for Distributed


Embedded Applications 3rd Edition Hermann Kopetz

https://ebookmeta.com/product/real-time-systems-design-
principles-for-distributed-embedded-applications-3rd-edition-
hermann-kopetz-2/
EMBEDDED SYSTEMS DESIGN USING
THE MSP430FR2355
LAUNCHPAD™
EMBEDDED SYSTEMS DESIGN USING
THE MSP430FR2355
LAUNCHPAD™
2 ND E DITION

Brock J. LaMeres
Brock J. LaMeres
Department of Electrical and Computer Engineering
Montana State University
Bozeman, MT, USA

ISBN 978-3-031-20887-4 ISBN 978-3-031-20888-1 (eBook)


https://doi.org/10.1007/978-3-031-20888-1
© The Editor(s) (if applicable) and The Author(s), under exclusive license to
Springer Nature Switzerland AG 2020, 2023

This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or
part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and
retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter
developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not
imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and
regulations and therefore free for general use.
The publisher, the authors, and the editors are safe to assume that the advice and information in this book are believed
to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty,
expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been
made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
Why Another Book on Embedded Systems?
Embedded computers represent one of the most pervasive technologies of our time. When most
people think of computers, they think of their laptops and workstations, or even the servers that are the
backbone of the Internet; however, when one begins to contemplate how many technologies around
them use small, inexpensive computers embedded as their “brains,” one begins to more fully understand
the magnitude of how many embedded computers exist in our society. If you look around any room you
will see technology that is so commonplace, you may not even realize that most of it is run by an internal
computer. Technologies such as appliances, thermostats, handheld devices, projectors, televisions,
personal assistants, and radios all have small computers within them that control their operation. As
one starts to notice all of the embedded computers around them, they will quickly notice that there are
orders of magnitude more embedded computers than the standard general-purpose computers that run
Windows® or iOS™. As these technologies become smarter and are Wi-Fi connected, we move into era
called the Internet of Things. This next technological paradigm shift will turn all of the embedded
computers into a collaborative network in an attempt to make our lives better by automating taking
mundane tasks.
Simultaneous to the exponential increase in embedded computers in our society is the need for
engineers and software developers that can build and program these systems. Due to the high popularity
of embedded computers, there is also a wide range of embedded computer platforms. As such, the
textbooks that exist to aid in the education of embedded computers are somewhat fragmented.
Textbooks for embedded computers aren’t able to be written at only the theoretical level such as circuits
and electronics textbooks. Instead, they must identify a computer platform and focus the content on that
specific embedded computer technology. This leads to a large number of embedded systems books to
support the large number of embedded platforms. This also leads to books becoming obsolete much
faster than traditional engineering textbooks.
One reason for a new book in this area is creating comprehensive content around a widely popular
embedded computer, the Texas Instruments MSP430. The MSP430 is a modern computer platform that
is mature in the market and has a great deal of technical and educational support behind it. This means
that this platform will be relevant and supported for at least the next 10–15 years.
A second reason for a new book in this area is to provide content the way people actual learn (i.e., by
doing). Current embedded systems books, even those targeting the MSP430, tend to only provide small
code segments that can’t be directly run on a target platform. This new book approaches content delivery
around the model that the reader is sitting at a computer with an MSP430 plugged in and running each of
the examples as they move through the book. This learn-a-little, do-a-little is a proven pedagogical
strategy. It also supports both active learning within the classroom and self-regulated learning for
individual readers.

A third reason for a new book in this area is to provide a seamless delivery of both assembly
language and C language programming of the MSP430. Most embedded systems books are structured
in one of three ways: (1) they only cover assembly; (2) they only cover C; (3) they attempt to cover both
but don’t provide sufficient details of either. This new book will begin in assembly language as a means to
show the lower-level operation of the computer hardware. It will then move into C to implement more
complex systems that require abstracting the lower-level hardware. With the design of the book
consisting of examples in both languages that can be directly coded and run, there will not be a void
between the examples and real implementation of the concepts as seen in other books.

v
vi • Preface

The three guiding principles for the design of this book are:

Learn by example This book is designed to teach the material the way it is learned, through example.
Every concept that is covered in this book is supported by numerous programming examples that
provide the reader with a step-by-step explanation for how and why the computer is doing what it is
doing.

Learn by doing This book targets the Texas Instruments MSP430 microcontroller. This platform is a
widely popular, low-cost embedded system that is used to illustrate each concept in the book. The book
is designed for a reader who is at their computer with the MSP430 plugged in so that each example can
be coded and run as they learn.

Build a foundational understanding first, then move into abstraction This book teaches
the basic operation of an embedded computer using assembly language first so that the computer
operation can be explored at a lower level. Once complicated systems are introduced (i.e., serial
communication and analog-to-digital converters), the book moves into the C programming language.
Moving to C allows the learner to abstract the operation of the lower-level hardware and focus on
understanding how to “make things work.” By spending time in assembly to understand the underlying
hardware, the transition to C can happen more rapidly while still leaving the reader with a foundational
understanding of the underlying hardware.
If this learning model is followed, the reader will come away with much more than knowledge of facts
and figures; they will have a skillset and experience with embedded systems that will be both marketable
and of key importance to our society.
This second edition adds two highly requested chapters: Chaps. 16 and 17. Both chapters provide
example programs on how to configure these systems and observe their operation.

How to Use This Book


This book is most effective when the reader has the Texas Instruments Inc. MSP430FR2355
LaunchPad™ Development Kit and codes along with the material. All examples can be directly run on
the LaunchPad™ board. All programs were created and compiled using the Texas Instruments Inc. Code
Composer Studio (CCS). This development environment is free from Texas Instruments and can be run
on multiple operating systems. Each of the examples noted with a keyboard are ones that are intended to
be coded in CCS and run on the LaunchPad™ board.
There are three supporting documents that should also be downloaded from Texas Instruments to
provide background for the material in this book. The first is the MSP430FR4xx and MSP430FR2xx
Family User’s Guide1. This document gives the general concept of operation for the MSP430 architec-
ture that is used on the specific microcontroller targeted in this book. Throughout this book, this
document is referred to as the “MSP430 User’s Guide.” The second document that should be retrieved
is the MSP430FR235x, MSP430FR215x Mixed-Signal Microcontrollers Device-Specific Data Sheet2.
This second document provides the specific details of the MSP430FR2355 microcontroller device that is
used in each example. Throughout this book, this document is referred to as the” Device-Specific Data
Sheet.” The final document that should be retrieved is the MSP430FR235x LaunchPad™ Development
Kit User’s Guide3. This document describes the circuitry implemented on the LaunchPad™ board. This
document is critical to understanding the types of input/output and programming capability available on
the LaunchPad™ board.
Preface • vii

Additional Resources
Supporting videos will be posted to the author’s YouTube channel, which can be found at https://
www.youtube.com/c/DigitalLogicProgramming_LaMeres. This channel contains many other videos
beyond embedded systems to help people learn digital logic, basic programming, and robotics. Sub-
scribe to this channel in order to be notified when new videos for this book are posted.

Bozeman, MT, USA Brock J. LaMeres


Acknowledgments
Endless thanks to my family for support of this project. JoAnn, Alexis, and Kylie: You are my rocks
and rockstars.

A huge thank you to all the Montana State University engineering students that helped with the
development of this book. They proofed, made suggestions, helped create examples and labs, created
slides, and even drew out explanations for the solutions manual. Go Bobcats!

ix
Contents
1: INTRODUCTION TO EMBEDDED SYSTEMS ......................................................... 1
1.1 WHAT IS AN EMBEDDED SYSTEM? ................................................................................ 1
2: DIGITAL LOGIC BASICS ......................................................................................... 7
2.1 NUMBER SYSTEMS ...................................................................................................... 7
2.1.1 Positional Number Systems .......................................................................... 7
2.1.2 Base Conversion ........................................................................................... 12
2.1.3 Binary Arithmetic ............................................................................................ 19
2.1.4 Unsigned and Signed Numbers .................................................................... 22
2.2 COMBINATIONAL LOGIC ................................................................................................ 29
2.2.1 Basic Gates .................................................................................................... 29
2.2.2 Boolean Algebra ............................................................................................ 31
2.2.3 Combinational Logic Synthesis ..................................................................... 34
2.2.4 MSI Logic ....................................................................................................... 56
2.3 SEQUENTIAL LOGIC ..................................................................................................... 71
2.3.1 Sequential Logic Storage Devices ................................................................ 71
2.3.2 Finite State Machines .................................................................................... 86
2.4 MEMORY ................................................................................................................... 104
2.4.1 Memory Terminology ..................................................................................... 104
2.4.2 Memory Architecture ...................................................................................... 106
2.4.3 Memory Technologies .................................................................................... 110
3: COMPUTER SYSTEMS ............................................................................................ 121
3.1 COMPUTER OVERVIEW ................................................................................................. 121
3.2 COMPUTER HARDWARE ................................................................................................ 122
3.2.1 Program Memory ........................................................................................... 123
3.2.2 Data Memory ................................................................................................. 123
3.2.3 Central Processing Unit ................................................................................. 123
3.2.4 Input/Output Ports .......................................................................................... 125
3.2.5 Bus System .................................................................................................... 125
3.3 COMPUTER SOFTWARE ................................................................................................ 126
3.3.1 Classes of Instructions .................................................................................. 126
3.3.2 Op-codes and Operands ............................................................................... 127
3.3.3 Program Development Flow .......................................................................... 129
4: THE MSP430 ............................................................................................................ 135
4.1 MSP430 HARDWARE OVERVIEW ................................................................................. 135
4.1.1 Word Versus Byte Memory Access ............................................................... 136
4.1.2 Program Memory ........................................................................................... 136
4.1.3 Data Memory ................................................................................................. 136
4.1.4 Central Processing Unit ................................................................................. 136
4.1.5 Input/Output Ports and Peripherals ............................................................... 138

xi
xii • Contents

4.1.6 Bus System .................................................................................................... 140


4.1.7 MSP430 Part Numbering ............................................................................... 141
4.2 MSP430 SOFTWARE OVERVIEW .................................................................................. 142
4.2.1 The MSP430 Instruction Set .......................................................................... 142
4.2.2 Word (.W) Versus Byte (.B) Operations ........................................................ 144
4.2.3 The TI Code Composer Studio Development Environment ......................... 145
4.3 MSP430FR2355 LAUNCHPAD™ DEVELOPMENT KIT .................................................... 146
5: GETTING STARTED PROGRAMMING THE MSP430 IN ASSEMBLY .................... 153
5.1 THE ANATOMY OF AN ASSEMBLY PROGRAM FILE ............................................................. 153
5.1.1 Instruction Statements ................................................................................... 153
5.1.2 Assembler Directives ..................................................................................... 154
5.1.3 Miscellaneous Syntax Notes ......................................................................... 157
5.2 YOUR FIRST PROGRAM: BLINKING LED ......................................................................... 158
5.3 USING THE CCS DEBUGGER ....................................................................................... 162
5.3.1 Resume, Terminate, and Suspend ................................................................ 162
5.3.2 Breakpoints .................................................................................................... 163
5.3.3 Viewing Register Contents ............................................................................ 164
5.3.4 Viewing the Contents of Memory .................................................................. 166
5.3.5 Stepping Your Program ................................................................................. 166
6: DATA MOVEMENT INSTRUCTIONS ....................................................................... 171
6.1 THE MOV INSTRUCTION WITH REGISTER MODE (RN) ADDRESSING ................................... 171
6.2 THE MOV INSTRUCTION WITH IMMEDIATE MODE (#N) ADDRESSING .................................. 173
6.3 THE MOV INSTRUCTION WITH ABSOLUTE MODE (&ADDR) ADDRESSING .......................... 175
6.4 THE MOV INSTRUCTION WITH SYMBOLIC MODE (ADDR) ADDRESSING ............................. 177
6.5 THE MOV INSTRUCTION WITH INDIRECT REGISTER MODE (@RN) ADDRESSING .................. 179
6.6 THE MOV INSTRUCTION WITH INDIRECT AUTOINCREMENT MODE (@RN+) ADDRESSING ....... 181
6.7 THE MOV INSTRUCTION WITH INDEXED MODE (X(RN)) ADDRESSING ................................ 183
7: DATA MANIPULATION INSTRUCTIONS ................................................................. 191
7.1 ARITHMETIC INSTRUCTIONS ........................................................................................... 191
7.1.1 Addition Instructions ...................................................................................... 191
7.1.2 Subtraction Instructions ................................................................................. 195
7.1.3 Increments and Decrements ......................................................................... 198
7.2 LOGIC INSTRUCTIONS ................................................................................................... 199
7.3 BIT SET AND BIT CLEAR INSTRUCTIONS ......................................................................... 203
7.4 TEST INSTRUCTIONS .................................................................................................... 204
7.5 ROTATE OPERATIONS ................................................................................................... 206
8: PROGRAM FLOW INSTRUCTIONS ........................................................................ 213
8.1 UNCONDITIONAL JUMPS AND BRANCHES ......................................................................... 213
8.2 CONDITIONAL JUMPS ................................................................................................... 215
8.2.1 Carry-Based Jumps ....................................................................................... 215
8.2.2 Zero-Based Jumps ........................................................................................ 217
8.2.3 Negative-Based Jumps ................................................................................. 218
Contents • xiii

8.2.4 Overflow-Based Jumps ................................................................................. 219


8.3 IMPLEMENTING COMMON PROGRAMMING CONSTRUCTS IN ASSEMBLY .................................. 220
8.3.1 Implementing While() Loop Functionality ...................................................... 220
8.3.2 Implementing For() Loop Functionality .......................................................... 221
8.3.3 Implementing If/Else Functionality ................................................................. 223
8.3.4 Implementing Switch/Case Functionality in Assembly .................................. 224
8.4 FLOW CHARTS ........................................................................................................... 225
9: DIGITAL I/O ............................................................................................................... 231
9.1 THE MSP430 DIGITAL I/O SYSTEM ............................................................................. 231
9.1.1 Port Direction Registers (PxDIR) ................................................................... 233
9.1.2 Port Input Registers (PxIN) ............................................................................ 233
9.1.3 Port Output Registers (PxOUT) ..................................................................... 233
9.1.4 Port Pull-up or Pull-down Resistor Enable Registers (PxREN) .................... 233
9.1.5 Port Function Select Registers (PxSEL1 and PxSEL0) ................................ 235
9.1.6 Digital I/O Enabling After Reset ..................................................................... 235
9.1.7 Using Literal Definitions from the MSP430.H Header File ............................ 236
9.2 DIGITAL OUTPUT PROGRAMMING ................................................................................... 237
9.3 DIGITAL INPUT PROGRAMMING ....................................................................................... 240
10: THE STACK AND SUBROUTINES ........................................................................ 247
10.1 THE STACK ................................................................................................................ 247
10.2 SUBROUTINES ............................................................................................................ 251
11: INTRODUCTION TO INTERRUPTS ....................................................................... 255
11.1 THE CONCEPT OF AN INTERRUPT ................................................................................... 255
11.1.1 Interrupt Flags (IFG) ...................................................................................... 255
11.1.2 Interrupt Priority and Enabling ....................................................................... 257
11.1.3 Interrupt Vectors ............................................................................................. 258
11.1.4 Operation of the Stack during an IRQ ........................................................... 260
11.1.5 Interrupt Service Routines (ISR) .................................................................... 261
11.1.6 Nested Interrupts ........................................................................................... 261
11.1.7 Interrupt Servicing Summary ......................................................................... 262
11.1.8 MSP430FR2355 Interrupts ............................................................................ 263
11.2 MSP430FR2355 PORT INTERRUPTS .......................................................................... 265
12: INTRODUCTION TO TIMERS ................................................................................ 273
12.1 TIMER OVERVIEW ....................................................................................................... 273
12.2 TIMER OVERFLOWS ON THE MSP430FR2355 .............................................................. 278
12.3 TIMER COMPARES ON THE MSP430FR2355 ................................................................ 289
12.4 CREATING PULSE WIDTH MODULATED SIGNALS USING TIMER COMPARES .......................... 293
12.5 TIMER CAPTURES ON THE MSP430FR2355 ................................................................ 297
13: SWITCHING TO THE C LANGUAGE ..................................................................... 301
13.1 BASICS OF C PROGRAMMING ON THE MSP430 ............................................................. 301
13.1.1 While() Loops in C ......................................................................................... 302
xiv • Contents

13.1.2 For() Loops in C ............................................................................................. 304


13.1.3 If/Else Statements in C .................................................................................. 305
13.1.4 Switch/Case Statements in C ........................................................................ 306
13.1.5 Arithmetic Operators in C .............................................................................. 307
13.1.6 Bitwise Logic Operators in C ......................................................................... 307
13.2 DIGITAL I/O IN C ........................................................................................................ 310
13.3 INTERRUPTS IN C ........................................................................................................ 313
13.4 TIMERS IN C .............................................................................................................. 316
14: SERIAL COMMUNICATION IN C ........................................................................... 327
14.1 UNIVERSAL ASYNCHRONOUS RECEIVER/TRANSMITTER (UART) ........................................ 327
14.1.1 The UART Standard ...................................................................................... 327
14.1.2 UART Transmit on the MSP430FR2355 ....................................................... 333
14.1.3 UART Receive on the MSP430FR2355 ........................................................ 355
14.2 SERIAL PERIPHERAL INTERFACE (SPI) ........................................................................... 359
14.2.1 The SPI Protocol ........................................................................................... 359
14.2.2 SPI Master Operation on the MSP430FR2355 ............................................. 363
14.2.3 SPI Slave Operation on the MSP430FR2355 ............................................... 384
14.3 INTER-INTEGRATED CIRCUIT (I2C) BUS .......................................................................... 385
14.3.1 The I2C Protocol ............................................................................................ 385
14.3.2 I2C Master Operation on the MSP430FR2355 ............................................. 395
14.3.3 I2C Slave Operation on the MSP430FR2355 ............................................... 417
15: ANALOG-TO-DIGITAL CONVERTERS .................................................................. 423
15.1 ANALOG-TO-DIGITAL CONVERTERS ................................................................................ 423
15.2 ADC OPERATION ON THE MSP430FR2355 ................................................................ 426
16: THE CLOCK SYSTEM ............................................................................................ 439
16.1 OVERVIEW OF THE MSP430FR2355 CLOCK SYSTEM ................................................... 439
16.1.1 Internal Very Low-Power Low-Frequency Oscillator (VLO) .......................... 439
16.1.2 Internal Trimmed Low-Frequency Reference Oscillator (REFO) .................. 439
16.1.3 External XT1 Oscillator (XT1) ........................................................................ 439
16.1.4 Internal Digitally Controlled Oscillator (DCO) ................................................ 440
16.1.5 Internal High-Frequency Oscillator (MODCLK) ............................................. 443
16.1.6 Master Clock (MCLK) .................................................................................... 443
16.1.7 Subsystem Master Clock (SMCLK) ............................................................... 444
16.1.8 Auxiliary Clock (ACLK) .................................................................................. 444
16.1.9 Default Settings on Power-Up ....................................................................... 446
16.1.10 CS Configuration Registers ........................................................................... 447
16.2 CONFIGURING THE CS ON THE MSP430FR2355 ......................................................... 456
17: LOW POWER MODES ........................................................................................... 463
17.1 OVERVIEW OF THE MSP430FR2355’S LOW POWER MODES ......................................... 463
17.1.1 Active Mode (AM) .......................................................................................... 464
17.1.2 Low Power Mode 0 (LPM0): CPU OFF ......................................................... 464
17.1.3 Low Power Mode 3 (LPM3): Standby ........................................................... 464
Contents • xv

17.1.4 Low Power Mode 4 (LPM4): Off .................................................................... 464


17.1.5 Low Power Mode 3.5 (LPM3.5): RTC Only ................................................... 465
17.1.6 Low Power Mode 4.5 (LPM4.5): Shutdown .................................................. 465
17.1.7 Example of Putting the MSP430FR2355 into Low Power Mode .................. 465

APPENDIX A: CONCEPT CHECK SOLUTIONS ......................................................... 469


REFERENCES .............................................................................................................. 471
INDEX ............................................................................................................................ 473
Chapter 1: Introduction to Embedded
Systems
This chapter introduces the general concept of an embedded system. The goal is to provide a high-
level understanding of what an embedded computer is, their role in modern society, and motivation to
learn more about them.
Learning Outcomes—After completing this chapter, you will be able to:
1.1 Describe the basic concept of an embedded system.

1.1 What Is an Embedded System?


When most people hear the term “computer” they immediately think of their laptops or PCs. More
recently, people have come to also associate portable devices such as smart phones and tablets with the
term computer; however, most people don’t tend to think of all of the modern electronics surrounding
them as computers. But in fact, the majority of the consumer electronics in our daily lives have a
computer that is controlling their operation. Items such as household appliances, thermostats, the mirror
controller in a vehicle, an office copy machine, and even a hearing aid are examples of electronics in our
daily lives that all have embedded computers at their core. The term to describe the small computers
within these electronic devices is an embedded computer. The entire system then becomes an embed-
ded system, implying that a small computer is included with the system and controls its operation [4–6].
So, what is the difference between the computers that we think of in laptops and workstations and
those embedded in the majority of consumer electronics? We will classify computers into two broad
categories: general-purpose and embedded. Let’s start with a general-purpose computer. This type of
computer is designed to run any type of software that the user desires. A user is able to install, uninstall,
and update software applications that meet the user’s current need. To support the abundance of
potential software applications that may be run, general-purpose computers have abundant resources
at their disposal. It is common for a general-purpose computer to have a variety of peripherals such as
displays, keyboards/keypads, mice, Internet connections, and wireless communication capability.
General-purpose computers also typically contain relatively high-performance hardware components
such as fast processors and large amounts of data and program storage. To manage the large amounts
of resources in a general-purpose computer, these devices require an operating system (OS). An
operating system controls all of the resources and allocates them to the various software applications
that are running. Common operating systems that you may be familiar with are Windows, iOS, and Linux.
All of these operating systems have the same purpose, to manage the hardware resources of the
computer so that any arbitrary software program may be successfully run on it. General-purpose
computers also are designed for heavy user interaction. A typical general-purpose computer is designed
to support a user sitting in front of it interacting with the software program using the keyboard, mouse,
and monitor.
Despite a general-purpose computer having abundant resources, the vast majority of the time these
resources are not being used. Activities such as typing an email or browsing the web use a very little
amount of the computer’s resources. But even though any single software program may only use a small
amount of the resources available, a general-purpose computer must contain everything that is poten-
tially needed to support a future program that may require the resources. To provide all of this capability,
general-purpose computers are relatively expensive compared to their embedded systems’

# The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 1


B. J. LaMeres, Embedded Systems Design using the MSP430FR2355 LaunchPad™,
https://doi.org/10.1007/978-3-031-20888-1_1
2 • Chapter 1: Introduction to Embedded Systems

counterparts with laptops and workstations costing hundreds to thousands of dollars. Additionally, to
support the large number of resources, general-purpose computers are typically implemented using a
group of integrated circuits (ICs), or chips. A general-purpose computer typically has one chip that
implements its central processing unit (CPU), other chips to implement the data memory (i.e., RAM), and
others to implement the program storage (i.e., hard drive or solid-state drive). A general-purpose
computer is considered a distributed architecture because the full functionality of the computer is spread
across multiple IC chips. This type of architecture supports very sophisticated CPUs and large amounts
of data and program memory.
Now let’s consider the concept of an embedded computer. Many of the electronics that are used in
our daily lives don’t require a high-performance computer that runs Windows or iOS. Your coffee maker
doesn’t require a cutting-edge processor to make your coffee. Your thermostat doesn’t need the ability to
run Microsoft Word to control the temperature of the room. What these types of applications need is a
computer that can respond to inputs from the outside world (i.e., button presses or sensor inputs) and the
ability to send control signals to other sub-systems to accomplish a task (i.e., heat the water reservoir or
turn on the furnace). In these types of applications, the computer needs just enough resources to get the
job done. The small computers used for these dedicated applications are embedded computers.
Embedded computers are also referred to as microcontrollers, or MCUs, because they are the primary
controller for their dedicated application.

Embedded computers have a variety of traits that differentiate them from general-purpose
computers. First, embedded computers are mostly implemented on a single IC. An embedded computer
does not require the large amounts of RAM and program storage as in a general-purpose computer, so
all of the components of the computer can be put onto a single IC. Embedded computers also are able to
include a variety of common peripherals such as timers, analog-to-digital converters, digital-to-analog
converters, and serial interfaces to make them as versatile as possible when it comes to controlling all
types of electronic devices. Depending on the amount of resources included, the physical size of an
embedded computer chip can be extremely small. Consider the size of a thumb drive. This small storage
stick has a full embedded computer system on it. Now compare that to the physical size of the hardware
that resides in a general-purpose laptop. The small size of an embedded computer chip gives it the ability
to be used in an endless list of applications.

Another attribute of an embedded computer is that it isn’t designed to run arbitrary software
programs that are installed at the will of the user. An embedded computer in a toaster isn’t designed
to have a new program installed by the user to make it control a microwave. The software that an
embedded system runs is called firmware to highlight that it is not intended to be changed frequently.
While some embedded systems can have their software updated by downloading a new program, this is
a highly infrequent occurrence in the life of the computer (how many times have you upgraded the
firmware in your car’s mirrors?). Since an embedded computer does not need to support general-
purpose software programs, its software can be designed to optimize the functionality for the application
at hand. This means there is a tight coupling between the hardware and software components of the
embedded computer. This provides an optimized design that is typically only suited for the application
that the embedded computer is made for. Embedded systems can contain operating systems; however,
these OSs aren’t anything like Windows or iOS. Instead, these operating systems act as task schedulers
coordinating real-time activities such as reading from buttons or sensors and performing response
actions. Operating systems for embedded computers are called real-time operating systems (RTOS),
reflecting their purpose as a task scheduler. Not all embedded computers run an RTOS, but many just
simply run dedicated software to accomplish a specific task.
1.1 What Is an Embedded System? • 3

Another attribute of an MCU is their low cost. While a general-purpose microprocessor chip can cost
tens to hundreds of dollars, an MCU can cost 10s of cents to a few dollars. This low cost is driven by the
high-volume manufacturing process used to create MCUs. As semiconductor manufacturing volume
goes up, the cost of the individual chips produced goes down. The low cost of an embedded computer
chip reveals the prevalence and popularity of the embedded computer. The number of embedded
computers sold globally is multiple orders of magnitude larger than general-purpose computers, and
this gap is only expected to grow as our devices become smarter and interconnected and more
functionality is embedded into automobiles. In 2018, over 25 billion MCUs were sold globally [1].
Compare this to the ~400 million personal computers (PCs) sold annually that are based on general-
purpose CPUs [2]. In fact, it is estimated that only ~2% of computer chips produced end up in PCs. To put
this in perspective, every year there are tens of billions of new embedded systems being created to
improve the quality of our lives [7,8].

Smart phones and tablets are a technology that has moved from the embedded systems category into
the general-purpose description over the past decade. When cellular phones and personal desktop
assistances first emerged, they were very much embedded systems. These devices were not able to
support arbitrary software being installed on them and were designed to perform very specific tasks (phone
calls, text messaging, scheduling, etc.); however, as processing technology advanced, cellular phones
began to have the power to support more general-purpose operating systems such as Android and iOS.
This gave them the ability to support different applications (i.e., apps) that could access the phone or
tablets’ abundant resources. Today, smart phones and tablets are considered general-purpose computers
and only different from laptops and workstations in their size, portability, and software support.
From an educational perspective, general-purpose computers and embedded computers are effec-
tively the same. They are both computers that consist of hardware resources that are programmed to
accomplish tasks using software. We can learn about the architecture of a computer using either, but
focusing on embedded computers has a few advantages. First, they are inexpensive enough that every
reader of this book can have an embedded computer sitting next to them where they can gain experience
programming the MCU to do a variety of tasks. This allows embedded systems education to move from
simply reading facts and figures to an active learning process where a deeper understanding of
computers can be obtained. An additional bonus of this approach is that after completing the exercises
in this book, the reader will have a practical skill set that is highly sought after in industry. Figure 1.1
shows a graphical depiction of the applications of computers and categorizing them into either general-
purpose or embedded.

CONCEPT CHECK

CC1.1 Why don’t we just make one computer chip that serves the needs of every application
on Earth? It seems like that would be a lot simpler than having thousands of different
computer products.
A) That isn’t practical because every application has a different set of
requirements. If we tried to create a “super chip” that could be simultaneously
used in high-end servers and microwave ovens, then our microwave ovens
would cost tens of thousands of dollars and consume much more electrical
power.
B) It is illegal to just have one computer chip design. It goes against the idea of
capitalism and competition in the marketplace.
C) They are still trying to create one computer chip that meets every application. It
is just really hard.
D) The answer to this concept check is A.
4 • Chapter 1: Introduction to Embedded Systems

Fig. 1.1
Applications of embedded system [9]
Exercise Problems • 5

Summary
v Computers can be put into two broad v Embedded computers have enough
categories: general-purpose and embedded. resources to “get the job done.” They are
v General-purpose computers are designed to implemented on a single IC, are very low in
run any arbitrary software program. Thus, cost, and have a tight coupling between their
they contain abundant hardware resources hardware and software that optimizes their
to support potential applications and a operation for the application they are
sophisticated operating system to manage designed for.
the resources. v The number of embedded computer chips
v Embedded systems have a small computer sold each year outnumbers general-purpose
embedded within them that controls the oper- computer chips by multiple orders of
ation of the device. magnitude.

Exercise Problems
Section 1.1: What Is an Embedded 1.1.10 Classify a computer with the following
attributes into either “general-purpose” or
System?
“embedded”: is the most popular type of com-
1.1.1 Classify a computer with the following puter on Earth.
attributes into either “general-purpose” or
1.1.11 For the following application, would a general-
“embedded”: runs a sophisticated operating
purpose computer or an embedded computer
system such as Windows.
be better suited: running the Windows
1.1.2 Classify a computer with the following operating system.
attributes into either “general-purpose” or
1.1.12 For the following application, would a general-
“embedded”: implemented on a single chip.
purpose computer or an embedded computer
1.1.3 Classify a computer with the following be better suited: controlling an Xbox.
attributes into either “general-purpose” or
1.1.13 For the following application, would a general-
“embedded”: can cost less than a US dollar.
purpose computer or an embedded computer
1.1.4 Classify a computer with the following be better suited: running a washing machine.
attributes into either “general-purpose” or
1.1.14 For the following application, would a general-
“embedded”: designed to run any arbitrary soft-
purpose computer or an embedded computer
ware application the user desires.
be better suited: controlling the radio in a car.
1.1.5 Classify a computer with the following
1.1.15 For the following application, would a general-
attributes into either “general-purpose” or
purpose computer or an embedded computer
“embedded”: can cost hundreds to thousands
be better suited: controlling a satellite.
of US dollars.
1.1.16 For the following application, would a general-
1.1.6 Classify a computer with the following
purpose computer or an embedded computer
attributes into either “general-purpose” or
be better suited: controlling a wireless router.
“embedded”: its software is called firmware to
highlight that it is rarely changed after being 1.1.17 For the following application, would a general-
deployed. purpose computer or an embedded computer
be better suited: running servers in a data farm
1.1.7 Classify a computer with the following
based on the Windows platform.
attributes into either “general-purpose” or
“embedded”: also called a microcontroller 1.1.18 For the following application, would a general-
because it controls the sub-systems around it. purpose computer or an embedded computer
be better suited: a laptop running iOS.
1.1.8 Classify a computer with the following
attributes into either “general-purpose” or 1.1.19 For the following application, would a general-
“embedded”: can have a real-time operating purpose computer or an embedded computer
system, but the OS primarily acts as a task be better suited: a Linux workstation used to
scheduler. develop for an MCU.
1.1.9 Classify a computer with the following 1.1.20 For the following application, would a general-
attributes into either “general-purpose” or purpose computer or an embedded computer
“embedded”: has a tight coupling between the be better suited: controlling a video doorbell.
hardware and software, which optimizes its
operation for the application at hand.
Chapter 2: Digital Logic Basics
This chapter provides a brief summary of classical digital logic design [10]. The point of this chapter
is to expose the reader to the main concepts of digital logic so that they are familiar with them when
moving into the computer organization topics covered later in the book. It is not intended to be an
in-depth coverage of digital logic design. Rather, it is intended to expose the reader to the terminology
used in digital logic, the most common number systems used in embedded systems, the basic logic
operations used in combinational logic, and the basic operation of sequential logic, including synchro-
nous registers and finite state machines.
Learning Outcomes—After completing this chapter you will be able to:
2.1 Describe the formation and use of positional number systems including conversions
between bases and basic arithmetic.
2.2 Describe the basic operation of combinational logic circuits.
2.3 Describe the basic operation of sequential logic circuits.
2.4 Describe the basic operation of semiconductor memory including different implementation
technologies.

2.1 Number Systems


Logic circuits are used to generate and transmit 1s and 0s to compute and convey information. This
two-valued number system is called binary. As presented earlier, there are many advantages of using a
binary system; however, the human brain has been taught to count, label, and measure using the
decimal number system. The decimal number system contains ten unique symbols (0 ! 9). In order
to bridge the gap between the way our brains think (decimal) and how we build our computers (binary),
we need to understand the basics of number systems. This includes the formal definition of a positional
number system and how it can be extended to accommodate any arbitrarily large (or small) value. This
also includes how to convert between different number systems that contain different numbers of
symbols. In this section, we cover three different number systems: decimal (ten symbols), binary (two
symbols), and hexadecimal (16 symbols). The study of decimal and binary is obvious as they represent
how our brains interpret the physical world (decimal) and how our computers work (binary). Hexadecimal
is studied because it is a useful means to represent large sets of binary values using a manageable
number of symbols. This section will also discuss how to perform basic arithmetic (addition and
subtraction) in the binary number system and how to represent negative numbers. The goal of this
section is to provide an understanding of the basic principles of number systems so that we can design
computer programs that use arbitrary number bases.

2.1.1 Positional Number Systems


A positional number system allows the expansion of the original set of symbols so that they can be
used to represent any arbitrarily large (or small) value. For example, if we use the ten symbols in our
decimal system, we can count from 0 to 9. Using just the individual symbols we do not have enough
symbols to count beyond 9. To overcome this, we use the same set of symbols but assign a different
value to the symbol based on its position within the number. The position of the symbol with respect to
other symbols in the number allows an individual symbol to represent greater (or lesser) values. We can
use this approach to represent numbers larger than the original set of symbols. For example, let’s say we

# The Author(s), under exclusive license to Springer Nature Switzerland AG 2023 7


B. J. LaMeres, Embedded Systems Design using the MSP430FR2355 LaunchPad™,
https://doi.org/10.1007/978-3-031-20888-1_2
8 • Chapter 2: Digital Logic Basics

want to count from 0 upward by 1. We begin counting 0, 1, 2, 3, 4, 5, 6, 7, 8 to 9. When we are out of


symbols and wish to go higher, we bring on a symbol in a different position with that position being valued
higher and then start counting over with our original symbols (e.g., . . ., 9, 10, 11,. . . 19, 20, 21,. . .). This is
repeated each time a position runs out of symbols (e.g., . . ., 99, 100, 101. . . 999, 1000, 1001,. . .).

First, let’s look at the formation of a number system. The first thing that is needed is a set of symbols.
The formal term for one of the symbols in a number system is a numeral. One or more numerals are used
to form a number. We define the number of numerals in the system using the terms radix or base. For
example, our decimal number system is said to be base 10, or have a radix of 10, because it consists of
ten unique numerals or symbols.

Radix = Basethe number of numerals in thenumber system

The next thing that is needed is the relative value of each numeral with respect to the other numerals
in the set. We can say 0 < 1 < 2 < 3, etc., to define the relative magnitudes of the numerals in this set. The
numerals are defined to be greater or less than their neighbors by a magnitude of 1. For example, in the
decimal number system each of the subsequent numerals is greater than its predecessor by exactly
1. When we define this relative magnitude, we are defining that the numeral 1 is greater than the numeral
0 by a magnitude of 1; the numeral 2 is greater than the numeral 1 by a magnitude of 1; etc. At this point
we have the ability to count from 0 to 9 by 1s. We also have the basic structure for mathematical
operations that have results that fall within the numeral set from 0 to 9 (e.g., 1 þ 2 ¼ 3). In order to expand
the values that these numerals can represent, we need define the rules of a positional number system.

2.1.1.1 Generic Structure


In order to represent larger or smaller numbers than the lone numerals in a number system can
represent, we adopt a positional system. In a positional number system, the relative position of the
numeral within the overall number dictates its value. When we begin talking about the position of a
numeral, we need to define a location to which all of the numerals are positioned with respect to. We
define the radix point as the point within a number to which numerals to the left represent whole numbers
and numerals to the right represent fractional numbers. The radix point is denoted with a period (i.e., “.”).
A particular number system often renames this radix point to reflect its base. For example, in the base
10 number system (i.e., decimal), the radix point is commonly called the decimal point; however, the term
radix point can be used across all number systems as a generic term. If the radix point is not present in a
number, it is assumed to be to the right of number. Figure 2.1 shows an example number highlighting the
radix point and the relative positions of the whole and fractional numerals.

Fig. 2.1
Definition of radix point
2.1 Number Systems • 9

Next, we need to define the position of each numeral with respect to the radix point. The position of
the numeral is assigned a whole number with the number to the left of the radix point having a position
value of 0. The position number increases by 1 as numerals are added to the left (2, 3, 4. . .) and
decreased by 1 as numerals are added to the right (1, 2, 3). We will use the variable p to represent
position. The position number will be used to calculate the value of each numeral in the number based on
its relative position to the radix point. Figure 2.2 shows the example number with the position value of
each numeral highlighted.

Fig. 2.2
Definition of position number (p) within the number

In order to create a generalized format of a number, we assign the term digit (d) to each of the
numerals in the number. The term digit signifies that the numeral has a position. The position of the digit
within the number is denoted as a subscript. The term digit can be used as a generic term to describe a
numeral across all systems, although some number systems will use a unique term instead of digit which
indicates its base. For example, the binary system uses the term bit instead of digit; however, using the
term digit to describe a generic numeral in any system is still acceptable. Figure 2.3 shows the generic
subscript notation used to describe the position of each digit in the number.

Fig. 2.3
Digit notation

We write a number from left to right starting with the highest position digit that is greater than 0 and
end with the lowest position digit that is greater than 0. This reduces the number of numerals that are
written; however, a number can be represented with an arbitrary number of 0s to the left of the highest
position digit greater than 0 and an arbitrary number of 0s to the right of the lowest position digit greater
than 0 without affecting the value of the number. For example, the number 132.654 could be written as
0132.6540 without affecting the value of the number. The 0s to the left of the number are called leading
0s and the 0s to the right of the number are called trailing 0s. The reason this is being stated is because
when a number is implemented in circuitry, the number of numerals is fixed, and each numeral must have
a value. The variable n is used to represent the number of numerals in a number. If a number is defined
with n¼4, that means four numerals are always used. The number 0 would be represented as 0000 with
both representations having an equal value.
10 • Chapter 2: Digital Logic Basics

2.1.1.2 Decimal Number System (Base 10)


As mentioned earlier, the decimal number system contains ten unique numerals (0, 1, 2, 3, 4, 5, 6, 7,
8, and 9). This system is thus a base 10 or a radix 10 system. The relative magnitudes of the symbols are
0 < 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9.

2.1.1.3 Binary Number System (Base 2)


The binary number system contains two unique numerals (0 and 1). This system is thus a base 2 or
a radix 2 system. The relative magnitudes of the symbols are 0 < 1. At first glance, this system looks very
limited in its ability to represent large numbers due to the small number of numerals. When counting up,
as soon as you count from 0 to 1, you are out of symbols and must increment the p þ 1 position in order to
represent the next number (e.g., 0, 1, 10, 11, 100, 101, . . .); however, magnitudes of each position scale
quickly so that circuits with a reasonable amount of digits can represent very large numbers. The term bit
is used instead of digit in this system to describe the individual numerals and at the same time indicate
the base of the number.
Due to the need for multiple bits to represent meaningful information, there are terms dedicated to
describing the number of bits in a group. When 4 bits are grouped together, they are called a nibble.
When 8 bits are grouped together, they are called a byte. Larger groupings of bits are called words. The
size of the word can be stated as either an n-bit word or omitted if the size of the word is inherently
implied. For example, if you were using a 32-bit microprocessor, using the term word would be
interpreted as a 32-bit word. For example, if there was a 32-bit grouping, it would be referred to as a
32-bit word. The leftmost bit in a binary number is called the Most Significant Bit (MSB). The rightmost bit
in a binary number is called the Least Significant Bit (LSB).

2.1.1.4 Hexadecimal Number System (Base 16)


The hexadecimal number system contains 16 unique numerals. This system is most often referred
to in spoken word as “hex” for short. Since we only have ten Arabic numerals in our familiar decimal
system, we need to use other symbols to represent the remaining six numerals. We use the alphabetic
characters A–F in order to expand the system to 16 numerals. The 16 numerals in the hexadecimal
system are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F. The relative magnitudes of the symbols are
0 < 1 < 2 < 3 < 4 < 5 < 6 < 7 < 8 < 9 < A < B < C < D < E < F. We use the generic term digit to describe the
numerals within a hexadecimal number.
At this point, it becomes necessary to indicate the base of a written number. The number 10 has an
entirely different value if it is a decimal number or binary number. In order to handle this, a subscript is
typically included at the end of the number to denote its base when writing out the number. For example,
1010 indicates that this number is decimal “ten.” If the number was written as 102, this number would
represent binary “one zero.” Table 2.1 lists the equivalent values in each of the four number systems just
described for counts from 010 to 1510. The left side of the table does not include leading 0s. The right side
of the table contains the same information but includes the leading 0s. The equivalencies of decimal,
binary, and hexadecimal in this table are typically committed to memory.
2.1 Number Systems • 11

Table 2.1
Number system equivalency (decimal, binary, hexadecimal)

When typing out different number bases within the MSP430 low-level programming environment,
special syntax is used to specify the desired base. Figure 2.4 shows the allowable syntax for specifying
constant literals for the MSP430. The term “literal” simply means that the number is to be treated as a
number, not as something else such as a location in memory.

Fig. 2.4
Specifying different number bases in the MSP430 low-level programming environment
12 • Chapter 2: Digital Logic Basics

CONCEPT CHECK

CC2.1.1 The base of a number system is arbitrary and is commonly selected to match a particular
aspect of the physical system in which it is used (e.g., base 10 corresponds to our 10 fingers,
base 2 corresponds to the 2 states of a switch). If a physical system contained 3 unique modes
and a base of 3 was chosen for the number system, what is the base 3 equivalent of the decimal
number 3?
A) 310 ¼ 113
B) 310 ¼ 33
C) 310 ¼ 103
D) 310 ¼ 213

2.1.2 Base Conversion


Now we look at converting between bases. There are distinct techniques for converting to and from
decimal. There are also techniques for converting between bases that are powers of 2 (e.g., base 2, 4,
8, and 16).

2.1.2.1 Converting to Decimal


The value of each digit within a number is based on the individual digit value and the digit’s position.
Each position in the number contains a different weight based on its relative location to the radix point.
The weight of each position is based on the radix of the number system that is being used. The weight of
each position in decimal is defined as:

Weight = ðRadixÞp

This expression gives the number system the ability to represent fractional numbers since an
expression with a negative exponent (e.g., xy) is evaluated as 1 over the expression with the exponent
change to positive (e.g., 1/x y). Figure 2.5 shows the generic structure of a number with its positional
weight highlighted.

Fig. 2.5
Weight definition

In order to find the decimal value of each of the numerals in the number, its individual numeral value
is multiplied by its positional weight. In order to find the value of the entire number, each value of the
individual numeral-weight products is summed. The generalized format of this conversion is written as:
2.1 Number Systems • 13

X
p max

Total Decimal Value ¼ d i ∙ ðradixÞi


i¼pmin

In this expression, pmax represents the highest position number that contains a numeral greater than
0. The variable pmin represents the lowest position number that contains a numeral greater than 0. These
limits are used to simplify the hand calculations; however, these terms theoretically could be þ1 to 1
with no effect on the result since the summation of every leading 0 and every trailing 0 contributes
nothing to the result.
As an example, let’s evaluate this expression for a decimal number. The result will yield the original
number but will illustrate how positional weight is used. Let’s take the number 132.65410. To find the
decimal value of this number, each numeral is multiplied by its positional weight and then all of the
products are summed. The positional weight for the digit 1 is (radix)p or (10)2. In decimal this is called the
hundred’s position. The positional weight for the digit 3 is (10)1, referred to as the ten’s position. The
positional weight for digit 2 is (10)0, referred to as the 1s position. The positional weight for digit 6 is (10)1
, referred to as the tenth’s position. The positional weight for digit 5 is (10)2, referred to as the
hundredth’s position. The positional weight for digit 4 is (10)3, referred to as the thousandth’s position.
When these weights are multiplied by their respective digits and summed, the result is the original
decimal number 132.65410. Example 2.1 shows this process step by step.

Example 2.1
Converting decimal to decimal
14 • Chapter 2: Digital Logic Basics

This process is used to convert between any other base to decimal. Let’s convert 101.112 to
decimal. The same process is followed with the exception that the base in the summation is changed
to 2. Converting from binary to decimal can be accomplished quickly in your head due to the fact that the
bit values in the products are either 1 or 0. That means any bit that is a 0 has no impact on the outcome
and any bit that is a 1 simply yields the weight of its position. Example 2.2 shows the step-by-step
process converting a binary number to decimal.

Example 2.2
Converting binary to decimal

Let’s now convert 1AB.EF16 to decimal. The same process is followed with the exception that the
base is changed to 16. When performing the conversion, the decimal equivalent of the numerals A–F
needs to be used. Example 2.3 shows the step-by-step process converting a hexadecimal number to
decimal.
2.1 Number Systems • 15

Example 2.3
Converting hexadecimal to decimal

In some cases, it is desired to specify a level of accuracy for the conversion in order to bound the
number of fractional digits in the final result. For example, if the conversion in Example 2.3 was stated as
“convert 1AB.EF16 to decimal with a fractional accuracy of 2 digits,” the final result would be 427.9310.
How rounding is handled can also be specified with the two options being with or without rounding. In the
case where the conversion is performed with rounding, additional fractional digits may need to be
computed to determine if the least significant digit of the new decimal fraction needs to be altered. For
example, let’s say the conversion in Example 2.3 is stated as “convert 1AB.EF16 to decimal with a
fractional accuracy of 4 digits with rounding.” In this case, the final result would be 427.933610. Notice
how rounding was applied to the digit in position p ¼ 3 changing it from a 5 to a 6 based on the value in
position p ¼ 4. Now let’s say the conversion in Example 2.3 is stated as “convert 1AB.EF16 to decimal
with a fractional accuracy of 4 digits without rounding.” In this case, the final result would be 427.933510.
Notice how without rounding simply drops all of the digits beyond the specified level of accuracy.

2.1.2.2 Converting from Decimal


The process of converting from decimal to another base consists of two separate algorithms. There
is one algorithm for converting the whole number portion of the number and another algorithm for
converting the fractional portion of the number. The process for converting the whole number portion
is to divide the decimal number by the base of the system you wish to convert to. The division will result in
a quotient and a whole number remainder. The remainder is recorded as the least significant numeral in
the converted number. The resulting quotient is then divided again by the base, which results in a new
quotient and new remainder. The remainder is recorded as the next higher-order numeral in the new
16 • Chapter 2: Digital Logic Basics

number. This process is repeated until a quotient of 0 is achieved. At that point the conversion is
complete. The remainders will always be within the numeral set of the base being converted to.
The process for converting the fractional portion is to multiply just the fractional component of the
number by the base. This will result in a product that contains a whole number and a fraction. The whole
number is recorded as the most significant digit of the new converted number. The new fractional portion
is then multiplied again by the base with the whole number portion being recorded as the next lower-
order numeral. This process is repeated until the product yields a fractional component equal to 0 or the
desired level of accuracy has been achieved. The level of accuracy is specified by the number of
numerals in the new converted number. For example, the conversion would be stated as “convert this
decimal number to binary with a fractional accuracy of 4 bits.” This means the final result would only have
4 bits in the fraction. In cases where the conversion does not yield exactly 4 fractional bits, there are two
approaches that can be used. The first is to have no rounding, which means the conversion simply stops
at the desired accuracy. The second is to apply rounding, which means additional bits beyond the
desired accuracy are computed in order to determine whether the least significant bit is reported.
Let’s convert 11.37510 to binary. Example 2.4 shows the step-by-step process converting a decimal
number to binary.

Example 2.4
Converting decimal to binary
2.1 Number Systems • 17

In many binary conversions to binary, the number of fractional bits that result from the conversion is
more than what is needed. In this case, rounding is applied to limit the fractional accuracy. The simplest
rounding approach for binary numbers is to continue the conversion for one more bit beyond the desired
fractional accuracy. If the next bit is a 0, then you leave the fractional component of the number as is.
If the next bit is a 1, you round the least significant bit of your number up. Often this rounding will result in
a cascade of roundings from the LSB to the MSB. As an example, let’s say that the conversion in
Example 2.4 was specified to have a fractional accuracy of 2 bits. If the bit in position p ¼ 3 was a
0 (which it is not, but let’s just say it is for the sake of this example), then the number would be left as is
and the final converted number would be 1011.012; however, if the bit in position p ¼ 3 was a 1 (as it
actually is in Example 2.4), then we would need to apply rounding. We would start with the bit in position
p ¼ 2. Since it is a 1, we would round that up to a 0, but we would need to apply the overflow of this
rounding to the next higher-order bit in position p ¼1. That would then cause the value of p ¼ 1 to go
from a 0 to a 1. The final result of the conversion with rounding would be 1011.102.

Let’s now convert 254.65510 to hexadecimal with an accuracy of three fractional digits. When doing
this conversion, all of the divisions and multiplications are done using decimal. If the results end up
between 1010 and 1510, then the decimal numbers are substituted with their hex symbol equivalent (i.e.,
A to F). Example 2.5 shows the step-by-step process of converting a decimal number to hex with a
fractional accuracy of three digits.

Example 2.5
Converting decimal to hexadecimal
18 • Chapter 2: Digital Logic Basics

Rounding of hexadecimal digits uses a similar approach as when rounding decimal numbers, with
the exception that the middle of the range of the numbers lies between digits 716 and 816. This means that
any number to be rounded that is 816 or greater will be rounded up. Numbers that are 716 or less will be
rounded down, which means the fractional component of the converted number is left as in.

2.1.2.3 Converting Between 2n Bases


Converting between 2n bases (e.g., 2, 4, 8, and 16) takes advantage of the direct mapping that each
of these bases has back to binary. Base 8 numbers take exactly 3 binary bits to represent all eight
symbols (i.e., 08 ¼ 0002, 78 ¼ 1112). Base 16 numbers take exactly 4 binary bits to represent all
16 symbols (i.e., 016 ¼ 00002, F16 ¼ 11112).

When converting from binary to any other 2n base, the whole number bits are grouped into the
appropriate-sized sets starting from the radix point and working left. If the final leftmost grouping does not
have enough symbols, it is simply padded on left with leading 0s. Each of these groups is then directly
substituted with their 2n base symbol. The fractional number bits are also grouped into the appropriate-
sized sets starting from the radix point, but this time working right. Again, if the final rightmost grouping
does not have enough symbols, it is simply padded on the right with trailing 0s. Each of these groups is
then directly substituted with their 2n base symbol.
Example 2.6 shows the step-by-step process of converting a binary number to hexadecimal.

Example 2.6
Converting binary to hexadecimal
2.1 Number Systems • 19

Example 2.7 shows the step-by-step process of converting a hexadecimal number to binary.

Example 2.7
Converting hexadecimal to binary

CONCEPT CHECK

CC2.1.2 A “googol” is the term for the decimal number 1e100. When written out manually
this number is a 1 with 100 0s after it (e.g., 10,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,
000,000,000,000,000,000,000,000). This term is more commonly associated
with the search engine company Google, which uses a different spelling but is
pronounced the same. How many bits does it take to represent a googol in
binary?
A) 100 bits
B) 256 bits
C) 332 bits
D) 333 bits

2.1.3 Binary Arithmetic


2.1.3.1 Addition (Carries)
Binary addition is a straightforward process that mirrors the approach we have learned for longhand
decimal addition. The two numbers (or terms) to be added are aligned at the radix point and addition
begins at the least significant bit. If the sum of the least significant position yields a value with two bits
(e.g., 102), then the least significant bit is recorded, and the most significant bit is carried to the next
higher position. The sum of the next higher position is then performed including the potential carry bit
from the prior addition. This process continues from the least significant position to the most significant
position. Example 2.8 shows how addition is performed on two individual bits.
20 • Chapter 2: Digital Logic Basics

Example 2.8
Single bit binary addition

When performing binary addition, the width of the inputs and output is fixed (i.e., n-bits). Carries that
exist within the n-bits are treated in the normal fashion of including them in the next higher position sum;
however, if the highest position summation produces a carry, this is a uniquely named event. This event
is called a carry out or the sum is said to generate a carry. The reason this type of event is given special
terminology is because in real circuitry, the number of bits of the inputs and output is fixed in hardware
and the carryout is typically handled by a separate circuit. Example 2.9 shows this process when adding
two 4-bit numbers.

Example 2.9
Multiple bit binary addition

The largest decimal sum that can result from the addition of two binary numbers is given by
2(2n1). For example, two 8-bit numbers to be added could both represent their highest decimal
value of (2n1) or 25510 (i.e., 1111 11112). The sum of this number would result in 51010 or (1 1111
11102). Notice that the largest sum achievable would only require one additional bit. This means
that a single carry bit is sufficient to handle all possible magnitudes for binary addition.
2.1 Number Systems • 21

2.1.3.2 Subtraction (Borrows)


Binary subtraction also mirrors longhand decimal subtraction. In subtraction, the formal terms for the
two numbers being operated on are minuend and subtrahend. The subtrahend is subtracted from the
minuend to find the difference. In longhand subtraction, the minuend is the top number and the
subtrahend is the bottom number. For a given position if the minuend is less than the subtrahend, it
needs to borrow from the next higher-order position to produce a difference that is positive. If the next
higher position does not have a value that can be borrowed from (i.e., 0), then it in turn needs to borrow
from the next higher position and so forth. Example 2.10 shows how subtraction is performed on two
individual bits.

Example 2.10
Single bit binary subtraction

As with binary addition, binary subtraction is accomplished on fixed widths of inputs and output (i.e.,
n-bits). The minuend and subtrahend are aligned at the radix point and subtraction begins at the least
significant bit position. Borrows are used as necessary as the subtractions move from the least signifi-
cant position to the most significant position. If the most significant position requires a borrow, this is a
uniquely named event. This event is called a borrow in or the subtraction is said to require a borrow.
Again, the reason this event is uniquely named is because in real circuitry, the number of bits of the input
and output is fixed in hardware and the borrow in is typically handled by a separate circuit. Example 2.11
shows this process when subtracting two 4-bit numbers.

Example 2.11
Multiple bit binary subtraction
22 • Chapter 2: Digital Logic Basics

Notice that if the minuend is less than the subtrahend, then the difference will be negative. At this
point, we need a way to handle negative numbers.

CONCEPT CHECK

CC2.1.3 If an 8-bit computer system can only perform unsigned addition on 8-bit inputs and
produce an 8-bit sum, how is it possible for this computer to perform addition on
numbers that are larger than what can be represented with 8-bits (e.g.,
100010 þ 100010 ¼ 200010)?
A) There are multiple 8-bit adders in a computer to handle large numbers.
B) The result is simply rounded to the nearest 8-bit number.
C) The computer returns an error and requires smaller numbers to be entered.
D) The computer keeps track of the carry out and uses it in a subsequent 8-bit
addition, which enables larger numbers to be handled.

2.1.4 Unsigned and Signed Numbers


All of the number systems presented in the prior sections were positive. We need to also have a
mechanism to indicate negative numbers. When looking at negative numbers, we only focus on the
mapping between decimal and binary since octal and hexadecimal are used as just another representa-
tion of a binary number. In decimal, we are able to use the negative sign in front of a number to indicate it
is negative (e.g., 3410). In binary, this notation works fine for writing numbers on paper (e.g., 10102),
but we need a mechanism that can be implemented using real circuitry. In a real digital circuit, the circuits
can only deal with 0s and 1s. There is no “” in a digital circuit. Since we only have 0s and 1s in the
hardware, we use a bit to represent whether a number is positive or negative. This is referred to as the
sign bit. If a binary number is not going to have any negative values, then it is called an unsigned number
and it can only represent positive numbers. If a binary number is going to allow negative numbers, it is
called a signed number. It is important to always keep track of the type of number we are using as the
same bit values can represent very different numbers depending on the coding mechanism that is
being used.

2.1.4.1 Unsigned Numbers


An unsigned number is one that does not allow negative numbers. When talking about this type of
code, the number of bits is fixed and stated up front. We use the variable n to represent the number of bits
in the number. For example, if we had an 8-bit number, we would say, “This is an 8-bit, unsigned number.”

The number of unique codes in an unsigned number is given by 2n. For example, if we had an 8-bit
number, we would have 28 or 256 unique codes (e.g., 0000 00002 to 1111 11112).
The range of an unsigned number refers to the decimal values that the binary code can represent. If
we use the notation Nunsigned to represent any possible value that an n-bit, unsigned number can take on,
the range would be defined as: 0 < Nunsigned < (2n 1)

Range of anUNSIGNED number ⇒ 0<N unsigned <ð2n  1Þ


2.1 Number Systems • 23

For example, if we had an unsigned number with n ¼ 4, it could take on a range of values from þ010
(00002) to þ1510 (11112). Notice that while this number has 16 unique possible codes, the highest
decimal value it can represent is 1510. This is because one of the unique codes represents 010. This is
the reason that the highest decimal value that can be represented is given by (2n1). Example 2.12
shows this process for a 16-bit number.

Example 2.12
Finding the range of an unsigned number

2.1.4.2 Signed Numbers (Two’s Complement)


Signed numbers are able to represent both positive and negative numbers. The most significant bit
of a signed numbers is always the sign bit, which represents whether the number is positive or negative.
The sign bit is defined to be a 0 if the number is positive and 1 if the number is negative. When using
signed numbers, the number of bits is fixed so that the sign bit is always in the same position. There are a
variety of ways to encode negative numbers using a sign bit. The encoding method used exclusively
in modern computers is called two’s complement. When talking about a signed number, the number
of bits and the type of encoding is always stated. For example, we would say, “This is an 8-bit, two’s
complement number.”
In a two’s complement encoding scheme, the negative number is obtained by subtracting its
positive equivalent from 2n. This is identical to performing a complement on the positive equivalent
and then adding 1. If a carry is generated, it is discarded. This procedure is called taking the two’s
complement of a number or performing two’s complement negation. The procedure of complementing
each bit and adding 1 is the most common technique to perform a two’s complement. In this way, the
most significant bit of the number is still the sign bit (0 ¼ positive, 1 ¼ negative), but all of the negative
numbers are in essence shifted up so that there are not duplicate codes for 0. Taking the two’s
complement of a positive number will give its negative counterpart and vice versa. Table 2.2 shows
the values represented by a 4-bit two’s complement number.
24 • Chapter 2: Digital Logic Basics

Table 2.2
Decimal values that a 4-bit, two’s complement code can represent

There are many advantages of two’s complement encoding that make it the prevalent signed
number scheme in modern computers. First, it uses all of the possible codes available to represent a
number (i.e., there are not two codes representing 0 that come from the notion of a positive 0 and
negative 0). Two’s complement also provides a sequence of numbers that are each 1 value away from
their neighboring codes when applying a traditional binary count. This ordering allows traditional addition
operations to be applied to two’s complement in the same manner as when using unsigned numbers.
Finally, the sequence of codes has a rollover characteristic, meaning that the highest value is only
1 value away from the lowest value. This characteristic means that when incrementing through as set of
two’s complement numbers, when you reach the maximum value and increment, it will go to the lowest
value and continue incrementing up.
The range of two’s complement numbers is a critical consideration when using this encoding
scheme. If we use the notation N2comp to represent any possible value that an n-bit, two’s complement
number can take on, the range of a two’s complement number is defined as:

   
Range of a TWO’ S COMPLEMENT number ⇒  2n1  N 2’s comp  þ 2n1  1

Example 2.13 shows how to use this expression to find the range of decimal values that a 32-bit,
two’s complement code can represent.
2.1 Number Systems • 25

Example 2.13
Finding the range of a two’s complement number

The process of finding the decimal value of a two’s complement number involves first identifying
whether the number is positive or negative by looking at the sign bit. If the number is positive (i.e., the
sign bit is 0), then the number is treated as an unsigned code and is converted to decimal using the
standard conversion procedure described in prior sections. If the number is negative (i.e., the sign bit is
1), then the number sign is recorded separately, and a two’s complement negation is performed on the
code in order to convert it to its positive magnitude equivalent. This new positive number is then
converted to decimal using the standard conversion procedure. The final step is to apply the sign.
Example 2.14 shows an example of this process on a negative number.

Example 2.14
Finding the decimal value of a two’s complement number
26 • Chapter 2: Digital Logic Basics

To convert a decimal number into its two’s complement code, the range is first checked to determine
whether the number can be represented with the allocated number of bits. The next step is to convert the
decimal number into unsigned binary. The final step is to apply the sign bit. If the original decimal number
was positive, then the conversion is complete. If the original decimal number was negative, then the
two’s complement is taken on the unsigned binary code to find its negative equivalent. Example 2.15
shows this procedure when converting 9910 to its 8-bit, two’s complement code.

Example 2.15
Finding the two’s complement code of a decimal number
2.1 Number Systems • 27

2.1.4.3 Arithmetic with Two’s Complement


Two’s complement has a variety of arithmetic advantages. First, the operations of addition, subtrac-
tion, and multiplication are handled exactly the same as when using unsigned numbers. This means that
duplicate circuitry is not needed in a system that uses both number types. Second, the ability to convert a
number from positive to its negative representation by performing a two’s complement means that
an adder circuit can be used for subtraction. For example, if we wanted to perform the subtraction
1310 – 410 ¼ 910, this is the same as performing 1310 þ (410) ¼ 910. This allows us to use a single adder
circuit to perform both addition and subtraction as long as we have the ability to take the two’s
complement of a number. Creating a circuit to perform two’s complement can be simpler and faster
than building a separate subtraction circuit, so this approach can sometimes be advantageous.
There are specific rules for performing two’s complement arithmetic that must be followed to ensure
proper results. First, any carry or borrow that is generated is ignored. The second rule that must be
followed is to always check if two’s complement overflow occurred. Two’s complement overflow refers to
when the result of the operation falls outside of the range of values that can be represented by the
number of bits being used. For example, if you are performing 8-bit, two’s complement addition, the
range of decimal values that can be represented is 12810 to þ12710. Having two input terms of 12710
(0111 11112) is perfectly legal because they can be represented by the 8 bits of the two’s complement
number; however, the summation of 12710 þ 12710 ¼ 25410 (1111 11102). This number does not fit within
the range of values that can be represented and is actually the two’s complement code for 210, which is
obviously incorrect. Two’s complement overflow occurs if any of the following occurs:

• The sum of like signs results in an answer with opposite sign (i.e., Positive þ Positive ¼
Negative or Negative þ Negative ¼ Positive).
• The subtraction of a positive number from a negative number results in a positive number (i.e.,
Negative  Positive ¼ Positive).
• The subtraction of a negative number from a positive number results in a negative number
(i.e., Positive  Negative ¼ Negative).

Computer systems that use two’s complement have a dedicated logic circuit that monitors for any of
these situations and lets the operator know that overflow has occurred. These circuits are straightforward
since they simply monitor the sign bits of the input and output codes. Example 2.16 shows how to use
two’s complement in order to perform subtraction using an addition operation.
28 • Chapter 2: Digital Logic Basics

Example 2.16
Using two’s complement addition to perform subtraction
2.2 Combinational Logic • 29

CONCEPT CHECK

CC2.1.4 A 4-bit, two’s complement number has 16 unique codes and can represent decimal
numbers between 810 to þ710. If the number of unique codes is even, why is it that the range of
integers it can represent is not symmetrical about 0?
A) One of the positive codes is used to represent 0. This prevents the highest
positive number from reaching þ810 and being symmetrical.
B) It is asymmetrical because the system allows the numbers to roll over.
C) It isn’t asymmetrical if 0 is considered a positive integer. That way there are
eight positive numbers and eight negatives numbers.
D) It is asymmetrical because there are duplicate codes for 0.

2.2 Combinational Logic


The goal of this section is to provide an understanding of the basic principles of combinational logic
design. This includes basic logic functions, Boolean algebra, and common synthesis techniques. The
term combinational logic refers to circuits where the output depends on the present value(s) of the inputs.
This simple definition implies that there is no storage capability in the circuitry and a change on the input
immediately impacts the output.

2.2.1 Basic Gates


The term gate is used to describe a digital circuit that implements the most basic functions possible
on the binary number system. Said another way, the inputs to a basic gate are 0s and 1s and the output is
either a 0 or 1. When discussing the operation of a logic gate, we ignore the details of how the 1s and 0s
are represented with voltages or currents. We instead treat the inputs and output as simply ideal 1s and
0s. This allows us to design more complex logic circuits without going into the details of the underlying
physical hardware. We often use also use the terms TRUE and FALSE to describe logic states with a
TRUE being equivalent to a 1 and FALSE being equivalent to a 0.

There are three common ways to represent the functionality of a basic gate. The first is a unique
symbol, which can be used in schematics. The second is a truth table, in which all possible input values
are listed along with the associated output. The third way to represent the gate functionality is with a logic
expression, which provides a way to express the logic in equation form. Figure 2.6 gives the functionality
for the basic gates used in combinational logic.
30 • Chapter 2: Digital Logic Basics

Fig. 2.6
Basic gate functionality

It should be noted that each of the 2-input logic operations can be expanded to have a larger number
of inputs. For an n-bit AND gate (where n > 2), the output is a logic 1 only when all of the inputs are 1s. A
NAND gate is always the inversion of the n-bit AND operation, regardless of the number of inputs.

For an n-bit OR gate (where n > 2), the output is a logic 1 when any of the inputs are a 1. A NOR gate
is always the inversion of the n-bit OR operation, regardless of the number of inputs.
2.2 Combinational Logic • 31

For an n-bit XOR gate (where n > 2), the functionality is created by cascading 2-input XOR gates.
This results in an output that is true when there is an ODD number of 1s on the inputs. This functionality is
much more useful in modern electronics for error correction codes and arithmetic. As such, this is the
functionality that is seen in modern n-bit, XOR gates. The 3-bit XOR functionality is also shown in
Fig. 2.7. An XNOR gate is always the inversion of the n-bit XOR operation, regardless of the number of
inputs.

Fig. 2.7
3-input XOR gate implementation

CONCEPT CHECK

CC2.2.1 Given the following logic diagram, which is the correct logic expression for F?

A) F ¼ (AB)0  C
B) F ¼ (A0 B0 )  C
C) F ¼ (A0 B0  C)
D) F ¼ AB0  C

2.2.2 Boolean Algebra


The term algebra refers to the rules of a number system. Algebra defines the operations that are
legal to perform on a system. Once we have defined the rules for a system, we can then use the system
for more powerful mathematics such as solving for unknowns and manipulating into equivalent forms.
The ability to manipulate into equivalent forms allows us to minimize the number of logic operations
necessary and also put into a form that can be directly synthesized using modern logic circuits.
In 1854, English mathematician George Boole presented an abstract algebraic framework for a
system that contained only two states, true and false. This framework essentially launched the field of
computer science even before the existence of the modern integrated circuits that are used to implement
32 • Chapter 2: Digital Logic Basics

digital logic today. In 1930, American mathematician Claude Shannon applied Boole’s algebraic frame-
work to his work on switching circuits at Bell Labs, thus launching the field of digital circuit design and
information theory. Boole’s original framework is still used extensively in modern digital circuit design and
thus bears the name Boolean algebra. Today, the term Boolean algebra is often used to describe not only
George Boole’s original work but all of those that contributed to the field after him.

In Boolean algebra there are two valid states (true and false) and three core operations. The
operations are conjunction (^, equivalent to the AND operation), disjunction (_, equivalent to the OR
operation), and negation (Ø, equivalent to the NOT operation). From these three operations, more
sophisticated operations can be created including other logic functions (i.e., BUF, NAND, NOR, XOR,
and XNOR) and arithmetic. Engineers primarily use the terms AND, OR, and NOT instead of conjunction,
disjunction, and negation. Similarly, engineers primarily use the symbols for these operators described
in Chap. 3 (e.g. ∙, þ and 0 ) instead of ^, _, and Ø.
An axiom is a statement of truth about a system that is accepted by the user. Axioms are very simple
statements about a system but need to be established before more complicated theorems can be
proposed. Axioms are so basic that they do not need to be proved in order to be accepted. Axioms
can be thought of as the basic laws of the algebraic framework. The terms axiom and postulate are
synonymous and used interchangeably. In Boolean algebra there are five main axioms. These axioms
will appear redundant with the description of basic gates in Fig. 2.6 but must be defined in this algebraic
context so that more powerful theorems can be proposed.
This axiom states that in Boolean algebra, a variable A can only take on one of two values, 0 or 1. If
the variable A is not 0, then it must be a 1, and conversely, if it is not a 1, then it must be a 0.

Axiom #1 – Boolean Values A ¼ 0 if A 6¼ 1, conversely A ¼ 1 if A 6¼ 0.


This axiom defines logical negation. Negation is also called the NOT operation or taking the
complement. The negation operation is denoted using either a prime (0 ), an inversion bar, or the negation
symbol (Ø). If the complement is taken on a 0, it becomes a 1. If the complement is taken on a 1, it
becomes a 0.

Axiom #2 – Definition of Logical Negation if A ¼ 0 then A0 ¼ 1, conversely, if A ¼ 1 then A0 ¼ 0.


This axiom defines a logical product or multiplication. Logical multiplication is denoted using either a
dot (∙), an ampersand (&), or the conjunction symbol (^). The result of logical multiplication is true when
both inputs are true and false otherwise.

Axiom #3 – Definition of a Logical Product A∙B ¼ 1 if A ¼ B ¼ 1 and A∙B ¼ 0 otherwise.


This axiom defines a logical sum or addition. Logical addition is denoted using either a plus sign (þ)
or the disjunction symbol (_). The result of logical addition is true when any of the inputs are true and
false otherwise.

Axiom #4 – Definition of a Logical Sum A þ B ¼1 if A ¼ 1 or B ¼ 1 and A þ B ¼ 0 otherwise.


This axiom defines the order of precedence for the three operators. Unless the precedence is
explicitly stated using parentheses, negation takes precedence over a logical product and a logical
product takes precedence over a logical sum.

Axiom #5 – Definition of Logical Precedence NOT precedes AND, AND precedes OR.
To illustrate Axiom #5, consider the logic function F ¼ A0 ∙B þ C. In this function, the first operation
that would take place is the NOT operation on A. This would be followed by the AND operation of A0 with
B. Finally, the result would be OR’d with C. The precedence of any function can also be explicitly stated
2.2 Combinational Logic • 33

using parentheses such as F ¼ (((A0 ) ∙ B) þ C). In schematic form, the order of operation evaluated
moving from the inputs to the output of each gate.
A theorem is a more sophisticated truth about a system that is not intuitively obvious. Theorems are
proposed and then must be proved. Once proved, they can be accepted as a truth about the system
going forward. Proving a theorem in Boolean algebra is much simpler than in our traditional decimal
system due to the fact that variables can only take on one of two values, true or false. Since the number
of input possibilities is bounded, Boolean algebra theorems can be proved by simply testing the theorem
using every possible input code. This is called proof by exhaustion.
Table 2.3 gives a summary of the most common Boolean algebra theorems. The theorems are
grouped in this table with respect to the number of variables that they contain. For each theorem, the
original form in given in addition to the dual. Duality is its own theorem that says a logic expression will
remain true if all 1s and 0s are interchanged and all AND and OR operations are interchanged. The dual
provides an additional set of theorems for each original form.

Table 2.3
Summary of Boolean algebra theorems

CONCEPT CHECK

CC2.2.2 If the logic expression F ¼ ABCDEFGH is implemented with only 2-input AND
gates, how many AND gates will it take? Hint: You can consider using the associative
property to manipulate the logic expression to use only 2-input AND operations, or,
you can sketch out a logic schematic using 2-input AND gates.
A) 4
B) 6
C) 7
D) 8
Another random document with
no related content on Scribd:
As the tide covered the Rock he could be seen in the clear
moonlight ploughing along the creamy surface, stretching his tether
in every direction in futile efforts to escape. At daylight next morning
he was found sheltering under a projecting ledge of rock. What a
clean, well-groomed fellow he looked, with his sleek, glossy coat
glistening in the sunshine, his squat, plump body adapting itself to
the inequalities of the surface on which it rested. His coat, by the
way, as much fur as that of a horse—grey above, mottled with dark
spots, while the under surface is of a creamy yellow. His beautiful
teeth gleaming white against the scarlet interior of his mouth, as he
snapped fruitlessly on either side, suggested the maximum of robust
animal health. As a memento of his visit the camera was brought on
the scene, and another addition made to our list of illustrious visitors.
Liberating him proved to be more difficult than his capture, for
when cut adrift he persisted in facing us instead of making for the
water, towards which we endeavoured to drive him. After some
manœuvring, however, he was driven to the edge of the gulley, but
even with his body half submerged he maintained a defensive
attitude, not seeming to realise that he was at liberty to depart. An
incoming wave, however, moved him to a sense of his position, and
with a defiant snort he slipped under water. Omitting, in his hurry, to
take proper bearings, he took the wrong direction, and, finding
himself in a cul-de-sac, made his appearance again on the surface,
and with a hurried glance at his position again sank, this time making
a bee-line for the outlet, being clearly seen, as he passed under
water close to where we stood, and was last seen buffeting his way
through the foaming breakers, evidently none the worse for his
compulsory detention on the Rock.
DECEMBER 1902.

The broken stones and other debris, consequent upon the late
alterations here, which had collected in various holes in the Rock
and maintained their position up till now, have nearly all been cleared
out by the severe gales of this month, and a couple of heavy iron
poles, erected lately to mark the boat tracks or entrances to the
landings, and which were sunk two feet in the solid rock and heavily
cemented, have been shaken loose in their sockets by the pounding
seas which have been besieging us of late. The rocks appear bleak
and bare, and utterly void of vegetation. The white whelks have
collected their scattered forces, and gone into winter quarters.
Secure in sheltering nooks, they lie huddled together in close packed
squadrons. Numerous small white banded whelks adhere to the
base of the tower with a tenacity that seems surprising considering
the swirling seas they are subjected to. This species, however, never
seem to dream of hibernating. The eiders and longtails, with an
unswerving attention to business, pursue their calling amid the hurly-
burly of broken, tumbling seas—evidently little concerned whether
the weather be fair or foul—and in the glassy hollows alternating
between the breakers they can be distinctly seen scurrying over the
rock surface like so many fish. Gannets this month are conspicuous
by their absence, and only a few parasitic gulls divide their attention
between the kitchen refuse and the hard won earnings of the eiders.
On several occasions during the month our fog signal was
brought into action through the occurrence of heavy snowfalls. A
silent, feathery fall on shore no doubt has charms peculiarly its own,
but at sea constitutes a very serious danger to the anxious mariner
as he steams at reduced speed through the fleecy curtain, shrieking
his every two minute warning, his vessel’s head scarcely visible from
the bridge. In snowstorms such as we have had of late our lantern
soon becomes plastered up with snow on the weather side,
necessitating constant removal to prevent it from completely blinding
our light in that direction. This is an operation often accomplished
with difficulty, especially when carried out in the teeth of a gale—an
experience somewhat akin to lying out on a yardarm under similar
conditions, only one doesn’t have the lift and ’scend of the vessel to
contend with; yet his grip must be equally as sure, or, as the old salts
phrase it, “Every finger a fish-hook,” on such occasions. Mounting by
an outside ladder to the grated gallery which encircles the base of
the lantern, one is exposed to the full force of the blast, and a firm
grip must be taken to avoid being blown away. Below, the seas in
wild tumult break against the building with a deafening roar, sending
a perceptible tremor through the entire structure with each impact.
Only by energetically hauling on the hand-rail can the slightest
progress be made in the desired direction, the wind’s eye being the
objective point, where possibly on arrival one may find himself
pinned flat to the lantern, like an entomological specimen, by the
force of the wind. The snow removed, the return journey is effected
by simply allowing oneself to be blown gradually back.
While relieving the Bass Rock on our way ashore last relief, a
good opportunity was afforded of witnessing the mode of effecting a
landing under adverse circumstances. On arrival there, it was
considered dangerous to attempt a landing at either of the two
landing places, owing to the heavy sea then running. The landings—
a flight of concrete steps from the water edge to the rocks above—
are situated on either side of a slight promontory immediately
beneath the lighthouse; and as deep water obtains to the rock face,
it will be obvious that similar conditions must frequently prevail at
either landing. The boat being loaded with the necessary stores, and
the relieving keeper on board, an approach was made to within
suitable distance of the Rock. A kedge anchor was then thrown
overboard, and the boat slacked down till within working distance.
The keepers meanwhile had been busy erecting an iron pole or
derrick on the rocks above the position now occupied by the boat,
and which, being slightly inclined seawards, a tackle from its
extremity was drawn by means of a guy-line to the boat, and the
stores hoisted ashore by the keepers in charge of the tackle-fall
above. Seated in a loop of the rope, the relieving keeper was then
hoisted, and his shore-going neighbour similarly lowered. As an
extra precaution, a second boat was sent from the ship to stand by
the working boat in case of accident. Fortunately, however, their
services were not required.
Our final relief here for the year was effected with some difficulty
on the 29th. Owing to the doubtful aspect of the landing, only one
boat was sent ashore instead of two as usual. The fortnightly supply
of coal and water being omitted on this occasion does not, however,
inconvenience us, as a three months’ reserve stock of necessaries is
always maintained during the winter months.
JANUARY-FEBRUARY 1903.

Bright, sunny weather characterised the opening day of the year,


the sea assuming a suspicious placidity quite summer-like in
appearance but for the keen nip in the air perceptible out of doors.
This state of affairs, however, proved but ephemeral, and for the
remainder of the month we have experienced most boisterous
weather. Strong westerly winds occasionally attained the force of a
gale, accompanied with driving seas, which roared and sang a
lullaby scarcely compatible with the shore-dwellers’ sense of
security, but which, strange to say, has a more somnolent effect
upon us than a breathless stillness, though an occasional thumper of
a sea, more forceful than its fellows, demonstrates the stability of our
domicile by imparting a gentle tremor to the entire structure,
awakening in the sleeper a glimmer of consciousness and a hazy
impression of a traction-engine lumbering somewhere in the vicinity.
Our entrance doorway—thirty feet from the Rock—faces south-
west, and is guarded by a heavy double leaved door, which opens
outwards, and held open against the building by means of heavy
brass thumb-snecks. An inner or vestibule door of solid brass is
placed six feet further inwards—the walls here, by the way, being
seven feet thick, tapering to one foot immediately beneath the
balcony, sixty feet higher up. This door is also double-leaved, with
the upper panels of heavy plate glass, frequently obscured by the
strong westerly wind whipping the tops of the seas as they rise in
front, and carrying them souse into the doorway. Standing here
during the prevalence of a gale, the outlook is being constantly
darkened by a curtain of hissing foam drawn across the doorway, as
each sea breaks against the base of the tower, flinging the spray
high overhead. Fifteen miles in front of us lies the Isle of May, with its
castle-like lighthouse crowning its summit, while on a lower level
stands a whitewashed relic—remnant of a time, not so long ago,
when the Island boasted a double light, and electricity had not as yet
usurped sole sway. Emerging from the right of the May appears the
bluff outline of the Bass Rock, while away in the far distance North
Berwick Law cleaves the sky-line. Away to St Abb’s Head, on the
left, the Haddington coast stretches hazy and indistinct, while the
green, grassy slopes of Fife, with the spires of St Andrews faintly
visible, fill in the right of the picture. Laying hold of the man-ropes
suspended in the doorway, and turning to the right, the Forfarshire
coast is seen extending from the Tay in a long unbroken line, with
the snow-clad Grampians towering majestically in the background.
Right in front of us are the smoking stalks of Arbroath. Two
conspicuous white dots in the foreground mark the pierheads, in
front of which an impatient “flaxer” cruises in glorious uncertainty of
ever being permitted to fulfil her charter and deposit her Riga-run
freight on the right side of the bar. This is the panorama from the
viewpoint of our doorway on a clear day, but, as seen of late through
sheets of flying foam, it reminds one of a cinematograph display, in
which the films are far from perfect.
On the first Sunday of the year hundreds of gulls were seen
resting on the surface of the sea, half a mile nor’-west from here,
evidently by their movements enjoying a feast of “fry,” and in all
probability proclaiming the presence of herring shoals. During the
gale of 10th January over a dozen gannets were seen swooping and
diving, presumably at herring. Only with difficulty could we maintain
our position on the balcony, owing to the force of the wind, yet these
birds circled and dived amid the turmoil of wind and water with a
graceful ease and precision that seemed truly wonderful considering
the force of wind they occasionally beat up against, or, as they
turned broadside on, were wafted without the least exertion in the
opposite direction. The first week of February saw hundreds of these
birds back to their breeding haunts on the Bass Rock. From the deck
of the “Relief” steamer lying within a few hundred yards their
movements are clearly seen. Each projecting ledge of the
precipitous cliffs is tenanted by some members of the cackling
crowd, their heads see-sawing from side to side. The birds are
evidently engaged in brisk conversation, a monopoly of which is
certainly not tolerated amongst them, judging by the vigorous efforts
of each to be heard above his neighbour. Probably the new
lighthouse is being discussed in the light of an innovation on their
ancestral rights of possession, and later, as its beams fall athwart
their nursery, tradition may recall man’s former intrusion on their
solitary keep many hundred years ago. No doubt their ups and
downs since last meeting on terra firma are fully discussed, for it is a
curious fact that these birds are rarely, if ever, known to rest on
shore except when engaged in domestic duties. Occasionally a
depraved specimen may be seen floating helplessly on the water, a
victim of his own gluttony, having dined not wisely but too well.
February has been a repetition of its predecessor, cold and blowy,
with excessive rainfalls. In a shallow depression on the higher rock
surface our attention has been attracted to a solitary plant, a
specimen, I understand, of “Himanthalia lorea.” A cylindrical stem
(an inch in length) supports a thick, fleshy disc, about an inch in
diameter. From the centre of this disc three separate branches rise
with their terminals, blunted at first, but which were gradually seen to
bifurcate. This is our “flower in the crannied wall,” and is in its own
way equally as suggestive.
The eiders are occasionally seen varying their diet with a
vegetable course. Seizing the tip of a tangle blade two or three
inches from the surface, they spin round it like a top, till the portion
held in their bill is twisted off and greedily swallowed. No need for
them to evade the gulls while engaged in this repast. It is most
amusing to witness the discomfiture of the gulls as they hurry from a
distance expecting to share in something edible, only to find the duck
negotiating six inches of seaweed. That the white whelk itself is not
immune from enemies was recently brought before our notice, one
being picked up with a long black worm dangling from its mouth. On
withdrawing the worm—somewhat resembling a boot lace—portions
of the deceased tenant followed. Doubtless every organism has its
own particular parasite.
“Big fleas have little fleas upon their backs to bite ’em,
And these again have lesser fleas and so ad infinitum.”
MARCH 1903.

Traditionally correct, the advent of this month was decidedly


leonine, and its exit as certainly lamb-like; but between these
periods, though a few really beautiful days could be credited to the
latter symbol of peacefulness, the lion was largely in the ascendant.
Borne on the off-shore wind comes the odour of heather—not the
fragrant perfume one usually associates with this sweet-smelling
plant, but the smoky incense consequent on moor-burning—and at
night the higher levels of the coast line exhibit lights which are
certainly not recognised in the Mariners’ Sailing Directions.
Over a score of steam trawlers have been busy in our
neighbourhood all the month. Sunday or Saturday is all the same to
them; they are at it night and day, and the weather must be bad
indeed to detain them in port. Often they are seen passing here
burying themselves to the foremast in the seas on their way to the
fishing grounds, perhaps twenty miles outside of us. The Rock
seems to be a recognised stage in their journey; for, whenever
abreast of it, over goes their log, and a compass course is laid for
the distant banks. Here, far outside the three-mile limit, the presence
of the Brenda or the Minna[1] causes no alarm; and, providing their
numbers are correctly exposed, receive no interference from these
coasting policemen. A few summers ago, one of these same
trawlers, while on her way out from Dundee one Sunday, surprised
us by driving right up on the reef in broad daylight, a hundred yards
from the tower. Fortunately, the sea was like glass at the time,
otherwise the consequences must have been disastrous. The tide
being on the ebb, their attempts to back off were unsuccessful; and
there they remained hard and fast from one o’clock till six in the
evening, when a passing trawler succeeded in towing them off,
evidently none the worse of their brief acquaintance with the Bell
Rock. During their detention, the crew paid us a visit in their boat,
recalling to our mind a story in which a clumsily handled brig, in
coming to an anchorage in a crowded harbour, ran aboard of a
vessel already anchored. Visiting this vessel a few days later, to
apologise for the occurrence, the offender was thus announced by
the steward: “Captain S—— has come on board, Sir.” “Oh, indeed,”
sarcastically remarked the aggrieved mariner. “Has he brought his
brig with him?”
The rocks are this year more plentifully strewn with mussel-spawn
and acorn barnacles than usual; and already the whelks have sallied
from their winter’s sleep, bent on their destruction. Hundreds of
hermit crabs have also made their appearance, notably first in the
deeper pools, but gradually taking up their quarters in the shallows.
Towards the end of the month, a few small spats of paidlefish spawn
were seen deposited in convenient crevices of the rocks. This is
unusually early for “nesting” operations, and engenders hopes of an
early fishing, as the ova is generally the first inducement for the
wandering cod to come within reach of our rods. Numerous clusters
of the wheat-like ova of the white whelk are also seen; but, unlike
that of the paidlefish (lumpsucker)—which may be detached from its
gelatinous fastenings in a solid mass—each egg adheres separately
by its own footstalk. Though the adult “paidles” are only to be seen
here during the period of incubation—the term seems quite
applicable, seeing that the guardian “cock” is always in close
attendance, with his nose thrust into the centre of the mass of ova, at
which point there is always a depression, and frequently a hole right
through it—juveniles are occasionally met with at all seasons; and,
on the first anniversary of their birthday, are seen to have attained
the length of two inches.
Numbers of peculiar looking slugs are met with at present,
somewhat resembling a section of a small orange with the skin
attached. On their upper surface, near to one end, a minute orifice is
seen, through which a small rosette like arrangement is protruded
when at rest, but which is instantly withdrawn when the animal is
disturbed. This is the only visible sign of life in this otherwise inert
object, and is probably its means of obtaining a living. Its under or
ambulatory surface is similar to that of a limpet, without its tenacity,
but with a somewhat similar rate of progression. Another small slug
noticed this month—no larger than one’s finger nail and recalling the
general appearance of the “fretful porcupine,” with “quills” arranged
along its back, and displaying beautiful shades of brilliant blue and
crimson.
Saturday, 14th.—A beautiful warm sunny day, the sea like glass,
dappled here and there with great greasy-like patches peculiar to still
weather. Flocks of eiders, longtails, and gulls appear to be having a
day off, and float listlessly hither and thither, seeming only intent on
making themselves aggressively audible in the stillness, the longtails
piping a shrill treble to the sonorous bass of the eiders, while the
gulls contribute a fairly good imitation of a laughing chorus. Later, the
gulls are seen to bestir themselves, as myriads of small circles break
the glassy surface in their vicinity, betraying the presence of “fry,”
their legitimate food. Pecking from side to side as they float silently
through the shoal, they evidently enjoy the feast thus provided for
them. The sight of the gulls thus engaged apparently reminds the
ducks of their negligence in this respect, and paddling full speed
ahead, they are soon busy diving in the shallower water of the reef.
The longtails push their way right up to the base of the tower, round
which they are seen circling, plucking at the green vegetation
adhering to the stonework, and cackling loudly as they breathe for a
few seconds on the surface, all unconscious of our presence on the
balcony above them. A small piece of coal dropped while they are
still under water causes them to shoot away like startled minnows,
and only when they have put some distance between them and the
source of alarm do they make their appearance on the surface,
evidently much flustered by the mysterious noise. Though a couple
of fathoms deep, their alarm was apparent at the same moment the
coal struck the surface, proving that the sound and not the
appearance of the falling body was the disturbing cause. The end of
the month still sees them in close attendance, but any day now may
witness their exodus. But few spring migrants have come our way
this month, principally a few blackbirds, thrushes, and starlings.

[1] Fishery Board cruisers.


APRIL 1903.

Warm, sunny weather in the earlier part of the month raised our
hopes of a change of diet, and, coupled with the early appearance of
the paidlefish spawn, our expectations of an early fishing ran high.
On the 8th, the capture of three small cods in “Johnny Gray” track
increased our hopes, and again on the 9th, eight were taken, but
since then we’ve had no other. Cold, blowy weather, with heavy
seas, has rendered all attempts in this direction futile; however, the
attraction—as evidenced by the stomachs of those captured—still
increases, and numbers of bloated paidle “hens,” with their lower
jaws protruding like a prize bull-dog, are seen cruising sluggishly
among the tangles in quest of a suitable nesting place. The nests
this season are unusually small; sometimes they contain as much
ova as would fill a quart pot. Each ovum is a sixteenth of an inch in
diameter, and were all permitted to come to maturity—instead of
becoming food for other fishes as most do—would soon fill the sea
of themselves. “All nature is at one with rapine and war,” and
necessarily so, otherwise we would soon be crowded out of
existence.
Our winter residents, the eiders and longtails, have gradually
disappeared. On the 4th, a representative pair of each alone
remained, but these have now thought better of it and gone the way
of their more sensible comrades. A few gulls, herring, and kittiwakes
hover about, and guillemots and gannets are now common.
The gannets, I am informed by the keepers on the Bass Rock,
commenced laying there on the 11th. The solitary egg these birds
deposit is heavily coated with lime, which, when scrubbed off,
exposes a pale blue surface. This coating is probably the origin of
the fallacy that these birds ensure the safety of their eggs by
cementing them to the bare rock. On the contrary, each nest is
composed of quite a barrow-load of material of the most
miscellaneous description. One of these nests noted on the Bass
this season was seen to have the end of a soft-soap barrel for a
foundation, armfuls of withered grass, dried tangles, bits of rope,
string, cotton waste, and other flotsam and jetsam picked up about
the Rock. Amongst the lining of the nest, pheasant and partridge
feathers were seen, which were certainly not garnered on the Bass.
The harvesting of the withered grass was accomplished between
dark and daylight, and, therefore, unnoticed by the keepers, but the
area of their operations, as seen next day, suggested the presence
of a lawn mower. Thousands of these birds are slaughtered annually
by the St Kildians as an article of diet, and the wonder is, considering
the solitary egg deposited and that three years elapse before the
adult stage is reached, that they continue so numerous.
Dr Wallace, in his “Natural Selection,” speaking of birds in
general, tells us that, if permitted to live, in the ordinary course of
production “in fifteen years each pair of birds would have increased
to more than two thousand millions. Whereas we have no reason to
believe that the number of the birds of any country increases at all in
fifteen or in one hundred and fifty years. On the average, all above
one become food for hawks and kites, wild cats or weasels, or perish
of cold and hunger as winter comes on.”
Myriads of white whelks are now scattered over the Rock surface,
and already patches of mussels and acorn barnacles have been
cleared by their voracity. Their ova, which is to be met with in almost
every nook and cranny, is left to take care of itself. A patch of this
ova is situated in a position which a paidle-hen subsequently fancied
for a nursery, and, scorning all rights of possession, plastered her
ova indiscriminately over that of the whelks, with the result that they
are now under the special care of the guardian “cock.”
A stranded cuttlefish was an object of much interest one evening
this month. What a queer-looking object it appeared, with its eight
long tentacles squirming in all directions, its body a slobbery mass of
animated mucilage. Although only a foot in diameter it required some
force to detach it from the rock, as each of the tentacles is furnished
with rows of suckers on its under side. By extending the tentacles in
front, the animal was able to move along the Rock surface, not in a
jerky fashion, as might be expected, but with a continuous gliding
motion, clearly showing that each sucker acted independently of its
neighbour. If taken hold of, one or other of the tentacles is
immediately twisted round the hand with a tenacity that seems
surprising considering the size of the animal, and one can then
realise to some extent the stories occasionally heard of its giant
relatives of the tropics. Irritated, it appears to have the properties of
the chameleon, flushing through all the gradations of colour in quick
succession, and latterly discharging a jet of fluid of inky blackness.
This resource, however, was utterly useless in the present
circumstances, but, on placing the animal in a shallow pool of water,
its use was at once apparent, for on being touched it immediately
rendered itself invisible by the inky fluid discharged. Frequent
irritation, however, exhausted its stock of ink, and latterly only clear
water was expelled. This expulsion, when effected on the Rock, was
accompanied by an audible murmur. The narrow slits of eyes closely
resemble those of a dog-fish, and the head, with the anterior tentacle
elevated in the air, grotesquely reminds one of an elephant in the act
of trumpeting.
MAY 1903.

During the first few hours of this month our lantern was the centre
of a twittering throng of feathered migrants. Wheatears, rockpipits,
starlings, wrens, and robins fluttered erratically through the rays or
clamoured in their innocence against the glass, apparently desiring a
closer acquaintance with the source of light. Puffs of feathers floated
away on the easterly breeze as some unfortunate, less discreet than
his fellows, crashed against the invisible barrier. The coming dawn,
however, reveals to the survivors the absurdity of their position, and
ere the light is extinguished they have resumed their journey
shorewards. Frequent fogs occurred in the earlier part of the month,
and during the prevalence of a long spell a long-eared owl was
captured on the balcony and held prisoner for a week, during which
time various samples of our commissariat were offered for his
acceptance without avail. A luckless sparrow, the only one by the
way I have seen here, was then captured and placed at his disposal.
This proved more in his line of business, for on the morning after the
rump and tail feathers alone were left. Next day the indigestible
portions, feathers, etc., were cast up in the form of a compact ball.
Later a thrush was similarly offered, but after a couple of days in
each other’s company remained untouched. It was amusing to see
the spirited attitude assumed by the thrush when in the presence of
his natural foe. Screaming aggressively at the slightest movement of
the owl, he would lunge furiously in his direction, his bill all the while
snapping audibly. The fog having cleared somewhat, both were then
set at liberty.
Another very rare visitor seen here this month was a sheldrake,
which passed close overhead flying south. This is the first I have
seen here, but in Orkney these birds are very numerous and are
there known as the burrow duck, or sly-goose. Sly they certainly are,
as evidenced by a pair which nested regularly within a couple of
hundred yards of the lighthouse at which I was then stationed. A
covered drain was the site annually chosen, the nest being placed
several yards from the mouth, which opened out on a spacious
grassy hollow. The bright brown and white plumage, with vermilion
bill and feet, render these birds most conspicuous objects in an
ordinary landscape; but squatting on a shingly beach, where their
colours harmonise better with their surroundings, their presence is
less easily detected. Frequently I have watched their movements
with a telescope from the lantern, and though no one was stirring
within seeing distance of them, the greatest caution was always
exercised in approaching the nest. Lighting a hundred yards from the
nest, a pretence of feeding diligently was made, though their heads
could be seen frequently lifting in the direction from which intrusion
was to be expected. Gradually circling nearer the nest, passing and
repassing it with apparent indifference, till within a few feet of it they
would then suddenly vanish. The exact moment of their entrance I
was never able to note, as they appeared to assume an invisibility
during the remaining few feet of their journey that was really
astonishing, but which is less a matter of surprise when one has
witnessed the squatting in concealment of a hen pheasant on sparse
grassy ground. Burrow duck is a name applied to these birds from
their habit of nesting in disused rabbit burrows. I have counted as
many as forty young ones following a single pair, while others may
have only three or four juveniles in their train. It is said they do not
scruple to steal the young ones from each other. If alarmed while
feeding among the decaying seaware on the beach, some of the
parents will fly to meet the intruder and endeavour to divert his
attention in another direction, while the others fly seawards, followed
by their callow broods flapping their little wings, while their feet tip-tip
the surface—a veritable walking on the waters.
Just as the rocks were being overflowed the other day, we had a
visit of another bird which is but rarely seen here, namely, the oyster-
catcher. The plumage beautiful black and white, the feet and bill a
brilliant red; the latter, which is flattened vertically, suggestive of a
stick of sealing wax. Though fairly well acquainted with this species, I
never had the good fortune till now to see them in the rôle of limpet
pickers, by which name they are known in some localities. From the
balcony, with the aid of the telescope, his movements were brought
within a few feet of us. Wading an inch or so deep, where the limpets
were probably opening to the influence of the incoming tide, he
appeared to make a judicious selection; then, with a single sidelong
blow of his chisel-like bill, he turned the no doubt astonished mollusc
upside down. Seizing it in his bill, he carried it to a still dry portion of
the Rock, and in a twinkling he had the limpet out of its shell, and
journeying up his long bill to its doom. The tip of the upper mandible
appeared to do the scooping out, while the lower merely acted as a
resistance outside the shell, the operation being performed more
quickly than even the adroit oyster-man turns out his wares on the
half-shell. Though not web-footed nor in the habit of diving, I
remember seeing one of these birds, which had been winged with a
gun-shot, dive repeatedly in order to escape further injury.
On the afternoon of the 16th, two days earlier than last year, a
loud chorus of discordant voices floating to our bedroom windows
announced the presence of a large flock of terns—their first arrival
here since wintering in the sunny south. Screaming and diving, they
appear tireless in the pursuit of their prey, which, with the aid of the
telescope, is seen to consist of inch-long “fry.” How trim and neat
they appear as they cluster on the rocks as the tide recedes, pruning
their feathers and chattering vociferously; the head enshrouded in a
black, glossy skull-cap, the back and wings a bluish grey, the under
parts of unsullied white; the long sharp-pointed scarlet bill tipped with
black in harmony with the legs, and small webbed feet. This active
little bird is also called the Sea Swallow, an alias assumed from its
long narrow wings and forked tail.
The sea has been literally alive with large poddlies this month.
Morning and evening they can be seen “breaking” on the surface in
pursuit of “fry,” splashing loudly in their efforts. Though somewhat
averse to our lure, we generally manage to secure a breakfast. On
quiet, still days, good sized cod are seen prowling over the rocks;
and, though lines were set at low water, they were seen at high
water to pass the temptation with indifference. Fishermen aver that
all fish have times when the most tempting delicacy fails to attract
their attention; and possibly this is the case with those which have
been lately under our observation. Hermit crabs at present are seen
to be carrying spawn; and one which was removed from its shell was
seen to have the spawn so far advanced that, when placed in a
shallow pool, they released their attachment with the parent, and
began life as free swimmers. A small fish of the blenny species,
when taken from the crevice in which the tide had left it, was quite
dark coloured, but when placed in a pool was seen to adapt itself to
the colouring of the bottom on which it rested, assuming a mottled
grey scarcely distinguishable from the pool bottom.
Painters have been busy for the latter half of this month repainting
the outside of the building. Favoured with suitable weather, a
fortnight sufficed for the operation of donning the triennial coat,
which will explain the apparent proximity with which it has been lately
viewed from Arbroath.
JUNE-JULY 1903.

A close inspection of the flowing tide as it swirls around our gratings


reveals the presence of myriads of minute globular jellyfishes—the
cydippe pileus—said to be the favourite food of the arctic whale,
though one would scarcely expect these bulky cetaceans to thrive or
even subsist on such watery diet. Ranging in size from a pin head to
a walnut, what a gap each mouthful must make in their numbers.
The poddlies themselves are not averse to this form of food, as they
are occasionally seen to disgorge them when landed in our doorway.
The common jellyfish progresses through the water with a pulsating
movement of the entire disc, such movement being termed
“pulmonigrade,” and somewhat resembles the action of an umbrella
being partially opened and closed. The mode of progression in the
case of the cydippe is, however, different, and is termed “ciliograde,”
as the propulsion is effected by means of eight vertical bands of cilia
or minute plates overlapping each other. Each plate having an
independent action of its own, the animal can propel itself in any
desired direction, or, by resting them against its spherical body, sink
to the bottom. In sunshine these animals in their evolutions emit the
most beautiful combinations of colour one could imagine, but “you
seize the flower, its bloom is shed”—scooped up in the hollow of the
hand their beauty vanishes, and only a small spat of inert
transparent jelly remains. Here at present in the Rock pools one may
witness a peculiar phase in the evolution of the jellyfish. Along with
many beautiful varieties of marine vegetation, miniature forests of fir
trees garnish the bottom of each shallow pool. These lilliputian firs,
with their branches no thicker than a hair, are but plants in
semblance, for here is the opening chapter in the life history of the
medusae. Under the lens each fragile shoot is seen to consist of
multitudes of small discs piled upon each other like so many
saucers, each of which will, in due course, detach itself from its
neighbour and enter on its new existence as fully equipped as the
exaggerated specimens frequently seen stranded on our beaches.
Lurking amongst the vegetation in the pools are numerous tiny
spider-crabs, roaming about in search of food. Only by their
movements can they be located, as each bears about with it quite a
luxuriant growth of vegetation, with which I understand all
crustaceans would become invested did they not—ludicrous as it
may seem—regularly attend to their toilet. The “spider,” however,
unable to procure a living by force of arms like his bigger brother,
has recourse to the subterfuge of posing as an innocent patch of
marine vegetation, and by such concealment is enabled to capture
food which would be otherwise unattainable. The females at present
are seen to be carrying spawn. When changing their position in the
pool it is somewhat surprising to see a portion of the plants, which
one has been admiring, suddenly become endowed with the powers
of locomotion, detach itself from the mass, and, ambling leisurely
round the pool, come to rest on the fringe of some other patch with
which it completely harmonises.
During the whole of June, at daybreak and again in the evening,
the sea around us appeared literally alive with large-sized poddlies.
Their continual flip-flop on the surface in pursuit of “fry” could be
distinctly heard from the balcony. Though frequently within reach of
our attempts from the doorway, they failed to appreciate our
invitation to any extent, and only with much perseverance did we
occasionally manage to breakfast at their expense. A few cod have
been taken from the pools at low water. The deepest of these pools
is about a couple of fathoms at low water, and has the reputation of
being a sort of convalescent home, as fish are occasionally taken
there which are in anything but the pink of condition. Fishing there
lately, I hooked a cod two feet long, and was somewhat surprised to
see the feeble resistance it made. On landing it, however, it was
seen to be a most phthisical-looking specimen and in the last stages
of emaciation, the bones almost protruding through the skin.
Needless to state, his life was spared, and the patient returned to his
element. I have frequently seen emaciated specimens of the cod
family, but as they were full grown, fishermen attributed this to old
age, but this was certainly not the case with our catch, it being but
half grown.

You might also like