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

Digital Logic Design Devices and

circuits by Gamal El Sheikh 9ed 9th


Edition Gamal El-Sheikh
Visit to download the full and correct content document:
https://ebookmeta.com/product/digital-logic-design-devices-and-circuits-by-gamal-el-s
heikh-9ed-9th-edition-gamal-el-sheikh/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Color Atlas of Human Gross Pathology Gamal Dawood

https://ebookmeta.com/product/color-atlas-of-human-gross-
pathology-gamal-dawood/

Lectures on Digital Design Principles (River Publishers


Electronic Materials, Circuits and Devices) 1st Edition
Pinaki Mazumder

https://ebookmeta.com/product/lectures-on-digital-design-
principles-river-publishers-electronic-materials-circuits-and-
devices-1st-edition-pinaki-mazumder/

The Sheikh CEO 1st Edition Yasar Jarrar

https://ebookmeta.com/product/the-sheikh-ceo-1st-edition-yasar-
jarrar/

Text Constructs 1st Edition Omar Sheikh Al Shabab

https://ebookmeta.com/product/text-constructs-1st-edition-omar-
sheikh-al-shabab/
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/

Partisan Universalism Essays in honour of Ato Sekyi Otu


Gamal Abdel-Shehid

https://ebookmeta.com/product/partisan-universalism-essays-in-
honour-of-ato-sekyi-otu-gamal-abdel-shehid/

Programming Logic and Design, Comprehensive 9th Edition


Joyce Farrell

https://ebookmeta.com/product/programming-logic-and-design-
comprehensive-9th-edition-joyce-farrell/

Secret Documents of Intelligence Branch on Father of


The Nation Bangladesh Bangabandhu Sheikh Mujibur Rahman
Volume 8 1964 1st Edition Sheikh Hasina Editor

https://ebookmeta.com/product/secret-documents-of-intelligence-
branch-on-father-of-the-nation-bangladesh-bangabandhu-sheikh-
mujibur-rahman-volume-8-1964-1st-edition-sheikh-hasina-editor/

Secret Documents of Intelligence Branch on Father of


The Nation Bangladesh Bangabandhu Sheikh Mujibur Rahman
Volume 10 1966 1st Edition Sheikh Hasina Editor

https://ebookmeta.com/product/secret-documents-of-intelligence-
branch-on-father-of-the-nation-bangladesh-bangabandhu-sheikh-
mujibur-rahman-volume-10-1966-1st-edition-sheikh-hasina-editor/
Digital Logic Design-I:
Devices and Circuits
(9th Edition)

by

Gamal El-Sheikh

Cairo 2023
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits i

Praise and Thanks be to ALLAH

To, in the name of ALLAH, my Father and Mother

To my wife and our daughters and sons

G.A. El-Sheikh
Cairo 2023

Copyright, 2023
The copyright of this book belongs to the author under the terms of the international
copyrights acts. All rights reserved. No part of this publication may be reproduced, stored in a
retrieval system, or transmitted in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise, without written permission of the Author.

ISBN:

‫لحلول الطباعة المتكاملة‬


‫ الجيزة‬- ‫ بجوار رئاسة حي الدقي‬- ‫ بين السرايات‬- ‫ش السكري‬7
01124888835 - 01063177771

dlogic100a
i
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits ii

Preface
The huge technological developments and ever-increasing human requirements motivated
many of the manufacturers to develop real world applications using digital systems and nao-
electronics. The digital systems are based on logical circuits and logical devices in addition to
pertinent application software. Thus, this book is devoted to provide both understanding of
the basic principles of digital logic design, and how these fundamental principles can be
applied in the building of digital and complex microprocessor circuits using current
technologies. Although the basic principles of digital logic design have not changed, the
design process and the implementation of the circuits are ever-changing. With the advances in
fully integrated modern computer aided design (CAD) tools for logic synthesis, simulation,
and implementation of circuits in programmable logic devices (PLDs) such as field
programmable gate arrays (FPGAs), it is now possible to design and implement complex
digital circuits very easily and quickly.

A traditional approach of introducing the basic principles and theories of logic design includes
the building of separate combinational and sequential components. These individual
components and the way of its utilization to build microprocessors are ultimate goals in
digital circuits. One primary goal of this book is to go beyond the logic principles, and the
building of individual components. In addition, these principles are utilized with the
individual components and combined together to create data paths and control units, and
finally the building of real dedicated custom microprocessors and general-purpose
microprocessors.

With any of the available CAD tools and the FPGA hardware development kits, students or
trainee can actually implement these circuits and justify its execution operation both in
software simulation and in hardware. The book contains many interesting examples with
complete circuit schematic diagrams that can be coded in any of the available simulation
software and implementation in hardware. With the hands-on exercises, the students or trainee
can learn not only the principles of digital logic design, but also in practice, how circuits are
implemented using current technologies. The book is divided into two parts; the first part is
devoted to basic principles and combinational networks while the second is devoted to
sequential circuits and pertinent applications.

The learning objectives of the first part of the book include the following:
 Recognize the different numbers' systems and codes in addition to mathematical
operations that can be carried with each.
 Describe the elements and characteristics that make up logic families; RTL, DTL, TTL,
CMOS.
 Recognize the types of basic logic gates, universal logic gates and special logic gates in
addition to different logic circuits used in digital equipment.
 Identify combined logic gates to build circuits and interpret their respective operation
via logic functions and Truth Tables.
 Design and realize addition and subtraction circuits, comparators, and special purpose
circuits.
 Design and realize combinational circuits including encoders, decoders, multiplexers,
demultiplexers in addition to real case studies.
 Design and realize combinational circuits to achieve any of the real world operations;
starting from the verbal description, truth table, logic expressions and logic circuit.
 Conduct experiments with any of the logic circuits (basic or designed) within the
laboratory and validate its performance with the help of laboratory instruments.

dlogic100a
ii
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits iii

In this edition, many of the Figures had modified to be better in addition to some illustrating
examples and extra real applications for different combinational networks. In addition,
appendices are added to cover the digital principles of system design towards good
understanding and laboratory experiments.

dlogic100a
iii
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits iv

Table of Contents
Preface
1- Introduction 1
1.1 History of Computational Fabrics 1
Evolution of Electronic Digital Devices
Basic Digital System Concepts
Digital System Design
Hierarchical System Design
1.2 Digital Systems 3
Levels of Integrated Circuits
Types of VLSI Chips
Digital Systems
Digital System Design Levels
Advantages of Digital Systems
Analog vs. Digital Systems
Building binary digital solutions to computational problems
Hardware Description Language (HDL)
Embedded Digital System
A Wireless Microsensor System
Temporal Representations of Electronic Signals:
Stored Program Digital Computer
Digital Computer Basic Operation

2- Numbers Systems and Codes 12


2.1 Introductory Background
2.1.1 Motivation
2.1.2 Computers and Numbers 13
2.1.3 Binary Number System Applications 16
2.2 Decimal (Base 10) Numbers 17
2.3 Binary (Base 2) Numbers 18
2.4 Octal (Base 8) Numbers 20
2.5 Hexadecimal (Base 16) Numbers 21
2.6 Numbers Conversions 23
2.6.1 Decimal Conversions 24
2.6.2 Binary Conversions 32
Binary into Decimal
Binary into Octal
Binary into Hexadecimal
2.6.3 Octal Conversions 35
Decimal and Octal Conversion
2.6.4 Hexadecimal Conversion 36
Decimal and Hexadecimal Conversion
2.6.5 Generalized Conversions 37
2.7 Numbers' Arithmetic 39
2.7.1 Binary Addition
2.7.2 Binary Subtraction
2.7.3 Signed Binary Numbers 40
Complementary Arithmetic
9’s and 10’s Complement

dlogic100a
iv
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits v

Signed Magnitude
1’s Complement
2’s Complement
Arithmetic Operations with Signed Numbers
Operations with Negative Numbers 46
Two’s Complement Motivation
2.7.4 Octal Arithmetic 48
Octal Addition
Octal Subtraction
2.7.5 Hexadecimal Arithmetic 49
Hexadecimal Addition
Hexadecimal Subtraction
2.8 Binary Multiplication and Division 53
2.9 Codes 55
2.9.1 Numerical (Binary) Codes 55
Classifications of Binary Codes
2.9.2 Binary-Coded Decimal (BCD) 56
BCD in Electronics
Packed BCD
BCD Conversion
BCD Addition
BCD Subtraction
Comparison with pure binary
Disadvantages
2.9.3 Gray Code 63
Binary to gray code conversion
Gray code to binary conversion
2.9.4 Excess-3 Code 65
Addition of two numbers in Excess-3 Code
2.9.5 Bi-quinary coded decimal Code; Decoding 66
2.9.6 Character (Alphanumeric) Codes 68
2.9.6.1 EBCDIC Code
2.9.6.2 ASCII Code
Parity Method
Cyclic Redundancy Check
Background
2.9.7 Error Detection and Correction 71
2.10 Binary Number System Applications 74
2.10.1 Binary Numbers in Electronics
2.10.2 Binary Bits of Zeros and Ones
2.10.3 Analogue Voltage Output
2.10.4 Digital Voltage Output
2.10.5 Digital Logic Levels
2.11 Exercises: Numbers' Systems and Codes 77

3- Logic Gates 79
3.1 Binary Logic 80
3.2 Logic Operations 81
3.2.1 Inversion (NOT) operation
3.2.2 OR Operation

dlogic100a
v
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits vi

3.2.3 AND Operation


3.2.4 Combined OR-AND operations
3.2.5 Truth Table
3.2.6 Symbols
3.2.7 Types of Logic Gates
3.3 Basic Logic Gates 83
3.3.1 The NOT (Inverter) Gate
3.3.2 The OR Gate
3.3.3 The AND Gate
3.3.4 Tristate Logic Gate (Tristate Buffer)
3.4 Universal Logic Gates 91
3.4.1 NAND gate (NAND = Not AND)
3.4.2 NOR gate (NOR = Not OR)
3.5 Special Logic Gates 95
3.5.1 EXOR (EXclusive-OR) Gate
3.5.2 EXNOR (EXclusive-NOR) Gate
3.6 Combinations of Logic Gates 98
3.6.1 Truth Tables and Logic Circuits
3.6.2 NAND gate Equivalents
3.6.3 NOR gate Equivalents
3.7 Electronics Implementation within Digital Logic Gates 101
3.7.1 Classification of Integrated Circuits
3.7.2 TTL and CMOS Logic Levels
3.7.3 DRL and DTL Logic Gates
3.7.4 TTL Logic Gates
3.7.5 Emitter-Coupled Digital Logic Gates
3.7.6 CMOS Gate Circuitry
3.7.7 Inverter Logic Gate
3.7.8 Static Logic Design of NAND, NOR, XOR and XNOR Gates
3.8 Digital Logic Gates Implementation within VHDL 109
3.8.1 NOT Gate Code
3.8.2 AND Gate Code
3.8.3 OR Gate Code
3.9 Exercises: Logic Gates and Logic Circuits 111
4- Boolean Algebra and Karnaugh Maps 113
4.1 Introduction
4.2 Boolean Algebra Rules 114
Two-Valued Boolean Algebra
4.3 Basic Theorems and Properties of Boolean Algebra 114
Duality
Basic Theorems
Operator Precedence
Boolean Functions
Logic Gate Implementation (Basic)
Complement of a Function
4.4 Canonical and Standard Forms 117
Minterms and Maxterms
Minterms (SOP)
Maxterms (POS)
4.5 Simplification of Boolean Functions 120

dlogic100a
vi
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits vii

4.5.1 Product of Sums (POS) Simplification


4.5.2 NAND and NOR Implementation
4.5.3 Don’t Care Conditions
4.6 Karnaugh Map (K-map) 123
4.6.1 K-mapping and Minimization Steps 123
4.6.2 Two variables map
4.6.3 Three variables map
4.6.4 Four variables map
4.6.5 Five variables map
4.6.6 Six variables map
4.7 Case studies 128
4.8 Exercises: Boolean Algebra and Logic Gates 135

5- Data Processing and Arithmetic Circuits 137


5.1 Comparison 137
5.2 Addition 140
5.2.1 Quarter Adder
5.2.2 Half Adder (HA)
5.2.3 Full Adder (FA)
5.2.4 Parallel Adders
5.2.5 Ripple Carry Adder
5.2.6 Carry Look Ahead Adder
5.3 Negative Numbers and Binary Subtraction 154
5.4 Subtraction 157
5.5 Exercises: Decoders, Encoders, and Adders/Subtractors 158

6- Combinational Networks 160


6.1 Decoders 160
6.1.1 Three-to-Eight-Line Decoder
6.1.2 Two-to-Four-Line Decoder with Enable and NANDs
6.1.3 Expanded Realization
6.1.4 BCD to Seven-Segment Decoder 164
6.1.5 Combinational Logic Implementation
6.2 Encoders 174
6.2.1 4-to-2 Bit Binary Encoder
6.2.2 Active High 8-to-3 Line Encoder
6.2.3 Active Low 8-to-3 Line Encoder
6.2.4 Priority Encoder
6.2.5 Eight-to-Three Bit Priority Encoder
6.2.6 Encoder Applications: Positional Encoders

6.3 Multiplexers 191


6.3.1 Two-Input Multiplexer
6.3.2 Four-Input Multiplexer
6.3.3 Combined Multiplexers
6.3.4 Multiplexer Expansion
6.4 Demultiplexers 197
6.4.1 The 1-to-2 Line Decoder/Demultiplexer
6.5 Boolean Functions Realization/ Implementation 198
6.5.1 Three-Variables Function

dlogic100a
vii
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits viii

6.5.2 Four-Variables Function


6.5.3 Multiplexers using Three-State Gates
6.6 Exercices: Decoders, Encoders and Multiplexers 202

References 205
Appendices 206
Appendix-A: Digital Principles of System Design Understanding 206
Appendix-B: Circuits' and Devices' Symbols 213
Appendix-C: Electronic Devices and Circuits: Significant Equations 220
Appendix-D: Laboratory Experiments and Assignments 228
Preface
Abstract: Logic Laboratories
Measuring Instruments
Lab-01: Basic Electronic Instruments and Measurements 234
Lab-02: Oscilloscope and Function Generator 239
Lab-03: Voltage, Current, Resistance and Power Measurements 243
Lab-04: Inverters 259
Lab-05: AND Gates 260
Lab-06: OR Gates 262
Lab-07: NAND and NOR Gates 264
Lab-08: XOR and XNOR Gates 266
Lab-09: Half- and Full-Adders 268
Lab-10: Half- and Full-Subtractors 269
Lab-11: 1’S Complement Adder /Subtractor 270
Lab-12: 2's Complement Adder/Subtractor 271
Lab-13: Multiplexers and Demultiplexers 272
Appendix-E: List of 7400 Series Integrated Circuits 274
E.1 Integrated Circuits Functioning
E.2 Integrated Circuits Pin Configuration
Appendix-F: List of 4000 Series Integrated Circuits 307
F.1 Integrated Circuits Functioning
F.2 Integrated Circuits Pin Configuration

dlogic100a
viii
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 1

1- Introduction
This book is devoted to provide both an understanding of the basic principles of digital logic
design, and how these fundamental principles can be applied in the building of complex
digital circuits using current technologies. Although the basic principles of digital logic
design have not changed the design process and the implementation of circuits are ever-
changing. With the advances in fully integrated modern computer aided design (CAD) tools
for logic synthesis, simulation, and the implementation of circuits in programmable logic
devices (PLDs) such as field programmable gate arrays (FPGAs), it is now possible to design
and implement complex digital circuits very easily and quickly. That is, the book has the
objective to enable readers grasping;
1- The concept and features of digital systems
2- Binary numbers and concepts analysis,
3- Number base conversion, complements and codes,
4- Digital logic gates, Integrated circuits and families,
5- The Boolean Algebra and Boolean functions with applications in logic circuits design,
6- The KMap method with different variables and applications in logic circuits design,
7- POS and SOP simplifications and applications in logic circuits design,
8- Design and realization of combinational logic circuits, including adders/subtractors
and code conversions, Decoders and Encoders, Comparators, Multiplexers and
Demultiplexers, and
9- Design and realization of sequential logic circuits starting by flip-flops towards
registers and counters with different applications.

1.1 History of Computational Fabrics


The computational technologies passed different eras that can be summarized as follows;
 Discrete devices: relays, transistors (1940s-50s)
 Discrete logic gates (1950s-60s)
 Integrated circuits (1960s-70s) e.g. TTL packages
 Gate Arrays (IBM 1970s): Transistors are pre-placed on the chip and Place and Route
software puts the chip together automatically; only program the interconnect (mask
programming)
 Software Based Schemes (1970’s-present): Run instructions on a general purpose core
 Application-Specific Integrated Circuit (ASIC) Design (1980’s to present)
1. Turn Verilog directly into layout using a library of standard cells
2. Effective for high-volume and efficient use of silicon area
 Programmable Logic (1980’s to present)
1. A chip that be reprogrammed after it has been fabricated
2. Examples: PALs, EPROM, EEPROM, PLDs, FPGAs
3. Excellent support for mapping from Verilog

The Evolution of Electronic Digital Devices can be described by the following stages;
 Individual gates constructed from vacuum tubes and discrete passive components (e.g.,
resistors and capacitors).
 Individual gates constructed from transistors and discrete passive components.
 Integrated circuits (IC) consisting of several transistors, passive components fabricated
in a single package of semiconductors.
 IC's are also called chips.

Dlogic101-gen General Introduction


1
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 2

The hierarchy that clarifies the Basic Digital System Concepts including Embedded Systems
Technologies is shown in (Fig. 1.1), where;
• Levels of design abstraction and hierarchy
– System (behavioral) level; highest level
– Register level; widely used for design in industry today
– Gate level; level we will deal with most in this class
– Transistor level; lowest level
• Top-down design: Begins at system level and moves toward transistor level
• Typical way for complex digital systems to be designed in industry
– CAD tools can synthesize lower levels of design abstraction from higher level descriptions
• The point of logic design necessitates CAD tools with matured designer

SOC

Programmable Mixte
ASIC / Logic Device
Processor
Technology
ASSP (PLDs)

Full Standard Gate Simple Reconfigurable


DSP
Processeur
Custom Cell Array PLD

Structured CPLD ASIC - FPGA Microcontroller


Asic

Sea of Gates FPGA

Gate Array Embedded


Processors

Fig. 1.1: Embedded Systems Technologies Analog

DSP = Digital Signal Processing


ASIC = Application-Specific Integrated Circuit
SOC = System On Chip
ASSP = Application-Specific Standard Product
PLD = Programmable Logic Devices
CPLD = Complex Programmable Logic Devices
FPGA = Field Programmable Gate Array

The process of Digital System Design is shown in (Fig. 1.2);


Fig. 1.2: Integrated circuit design process

Dlogic101-gen General Introduction


2
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 3

The Hierarchical System Design can be valuable as;


• Hierarchy is everywhere;
– Systems consist of units
– Units consist of printed circuit boards (PCBs)
– PCBs consist of integrated circuits (ICs)
– ICs consist of logic gates
– Logic gates consist of transistors/devices
• Allows to partition big design into manageable components
• Once the circuit design works, the redesign is devoted to;
– reuse it through hierarchical design
– educes design time and design errors

1.2 Digital Systems


Electronic circuits and systems may be divided into analog and digital;
 Analog circuits are generally used with small signals and consequently operating in
linear mode (e.g. Operational amplifiers)
 Digital circuits are generally used with large signals and consequently operating in
nonlinear mode (e.g. remote control of light in a parking area according to sunset –on-
and sunrise –off-)

Analog signals are continuous and all possible values are represented (e.g. temperature
sensors, pressure sensors, …) while digital signals are used to represent a finite number of
discrete values. In addition, digital circuits and systems can be used to process both analog
and digital signals, but not vice versa.

Digital electronics involves circuits that have exactly two possible states either 0 or 1. That is,
the electronic circuit operation can be described in terms of its voltage levels; one level is
more positive than the other (corresponding to 1/H/T and zero/L/F, respectively)

Digital signals are characterized by the following parameters (Fig. 1.3):


1- Switching (tsw) is the time required/taken to transfer from one state to the other.
2- Period (T) is the time duration between two successive
pulses T
3- Frequency f=1/T tH
4- Rise time (tr) is the time required/taken to raise from 1.1
L to 0.9H of the signal
5- Fall time (tf) is the time required/taken to fall from H to L tL
levels of the signal
6- Duty cycle is a measure of how symmetrical or how Fig. 1.3: Pulse waveform
unsymmetrical the waveform is;
D CH  t H / T, D CL  t L / T

Logic Conventions
 The use of 0 (F) and 1(T) must be associated with the H and L voltages. It does not
matter which way it is done.
 If 1(T) is assigned to H and 0(F) to L we say we are using the positive logic convention.
 If 0(F) is assigned to H and 1(T) to L we say we are using the negative logic
convention.

Dlogic101-gen General Introduction


3
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 4

Digital IC is constructed using numerous transistors and resistors to perform a given logic
operation, where the transistor is used as an electronic switch. Buffer is used to deliver the
necessary load current without affecting the control circuit.

Digital operations include the following;


1- Counting
2- Addition and subtraction
3- Logic functions (not, And, Or)
4- Comparison (<, =, >)
5- Input and/or output

Basic Characteristics
 Signals can assume only a discrete number of values, usually two.
 For two-valued systems, it is usual to designate the two signal voltages as L and H (for
Low and High) instead of referring to them by the actual voltages of the signals.

Advantages of two-valued signals:


 Noise immunity
 Unlimited precision: use multiple signals
 Simple, cheap and stable circuits
 Easy to detect one of two values - thresholds

Digital system models are based on discrete math and algorithms;


 Boolean algebra
 Graphical state transition graphs
 Algorithms (flow charts, programs), Hardware Description Languages (HDL)

Levels of Integrated Circuits


 Small Scale Integrated circuits (SSI): A few gates per chip, most gate terminals available
at chip pins.
 Medium Scale Integrated circuits (MSI): Many gates and flip-flops interconnected on a
chip (e.g., adder or register).

SSI and MSI devices are also called standard chips in textbooks.

 Large and Very Large Integrated Circuits (LSI and VLSI): Millions of transistors
interconnected form complete systems (e.g., a microprocessor).
 VLSI devices have hundreds to thousands of millions of transistors on a single chip.

The number of transistors that can be put on a single chip has been doubled every 1.5 to 2
years.

Types of VLSI Chips


 Programmable Logic Devices
1. ROM’s PLA’s and PAL’s
2. Complex PLD’s (CPLD)
3. Field Programmable Gate Arrays (FPGA’s)
 Custom or Semi-Custom Chips
Applications-Specific Integrated Circuits (ASIC’s)

Dlogic101-gen General Introduction


4
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 5

Digital Systems
 Most general model of a digital system Fig. 1.4
‒ Often referred to as General Sequential Logic (Huffman
model)
‒ It consists of: Combinational logic that performs logical
operations and Memory elements that stores data
‒ Combinational Logic:
• Control Logic
• Arithmetic/Logic Unit (ALU)
• Multiplexers (MUX)
‒ Sequential Logic:
• Program Memory (MEM)
• Program Counter (PC)
• Address Register (AR)
• Data Register (DR)
• Input Register (IN)
• Output Register (OR)
• Accumulator (AC)
• ALU Carry Register (C)
• Instruction Register (IR)
• Timing Counter (TC)

Digital System Design Levels


 System Design
1. High-level architecture
2. Hardware and software partitioning
 Board-Level
1. Printed Circuit Board (PCB) development
2. Combine Integrated Circuits (ICs) to achieve design goals
 Integrated Circuit Design
1. Programmable logic (PLAs, PALs, PLDs)
2. Semi-custom design (FPGAs)
3. Full custom (VLSI)
 Device Electronics

Analog: Continuously varying signal


Digital: Discrete values, assumed instantaneous transition
In reality, digital assumption is approximation
Fig. 1.5
Advantages of Digital Systems
• Reproducible results • Small size
• Relative ease of design • Low cost
• Flexibility and functionality • Low power
• High speed • Steadily advancing technology
• High accuracy • Programmable logic devices

Dlogic101-gen General Introduction


5
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 6

Analog vs. Digital Systems


Analog Digital

Continuous time varying Discrete signals sampled in time has two possible values:
voltages and/or currents  0V, low, false (logic 0)
 5V, high, true (logic 1)
i.e. it is represented by binary values; 1/0, True/False, Hot/Cold,
On/Off, etc.
Basic elements of analog Basic elements of digital circuits: Logic gates:
circuits:  AND
• Resistors  OR
• Capacitors  NOT
• Inductors
• Transistors
Has ambiguity (different Has only one interpretation
interpretations)
Have additional data added to it to allow for detection and
correction of errors
Can be transmitted over a medium that introduces errors that are
corrected at receiving end
Can be used to process both analog and digital signals

Building binary digital solutions to computational problems;

Fig. 1.6

Dlogic101-gen General Introduction


6
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 7

Hardware Description Language (HDL)


Logic synthesis using a Hardware Description Language (HDL) automates the most tedious
and error-prone aspects of design;

Fig. 1.7
VHDL has been at the heart of electronic design productivity since initial ratification by the
IEEE in 1987. For many years the electronic design automation industry has expanded the use
of VHDL from initial concept of design documentation, to design implementation and
functional verification. It can be said that VHDL initiated modern synthesis technology and
enabled the development of ASIC semiconductor companies.

The use of VHDL has evolved and its importance increased as semiconductor devices
dimensions have shrunk. In the near past it was common to mix designs described with
schematics and VHDL. But as design complexity grew, the industry abandoned schematics in
favor of the hardware description language only. The industry has seen the use of VHDL’s
package structure to allow designers, electronic design automation companies and the
semiconductor industry to experiment with new language concepts to ensure good design tool
and data interoperability.

The Verilog HDL and VHDL industry standards teams collaborated on the use of a common
timing data such as IEEE 1497 SDF, register transfer level (RTL) standards and more to
improve design methodologies and the external connections provided to the hardware
description languages. The design community continues to see benefits as the electronic
design automation community continues to find new algorithms to work from VHDL design
descriptions and related standards to again push designer productivity. In addition, as a new
generation of designers of programmable logic devices move to the use of hardware
description languages as the basis of their design methodology, there will be substantial
growth in the number of VHDL users. In addition to the VHDL packages (Modelsim,
Multisim, etc.) the MATLAB with SIMULINK can be used to model and simulate the
operation of logic circuits. Moreover, the MATLAB with SIMULINK has the capability to
transfer circuits into VHDL code towards the intended chip.

Dlogic101-gen General Introduction


7
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 8

Embedded Digital System

Fig. 1.8

A Wireless Microsensor System;

Fig. 1.9
Temporal Representations of Electronic Signals;

Fig. 1.10: DC or "Step" Signal

Dlogic101-gen General Introduction


8
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 9

Fig. 1.11a: Low Frequency Sinusoidal Signal Fig. 1.11b: High Frequency Sinusoidal Signal

Fig. 1.12a: Amplitude Modulated (Analog) Signal Fig. 1.12b: Frequency Modulated (Analog) Signal

Fig. 1.13: Real Analog Signal - Video Luminosity

Dlogic101-gen General Introduction


9
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 10

Fig. 1.14: Real Analog Signal - Bat Sonar

Real Digital Signal


Idealized Digital Signal

Amplitude Modulated Digital Signal Frequency Modulated Digital Signal


Fig. 1.15

Dlogic101-gen General Introduction


10
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 11

Digital Computer (Fig. 1.16);


• Good example of a digital system
• Basic architecture consists of: Central Processing Unit (CPU)
– CPU: Control Unit, ALU
– Memory Control Unit
– Input/Output (I/O) Devices

Memory: Arithmetic Logic Unit (ALU)


Program Memory (MEM)
Data Register (DR)
I/O Devices: Memory I/O Devices
Input Register (IN)
Output Register (OR) Fig. 1.16: Digital Computer
Arithmetic-Logic Unit:
Arithmetic/Logic Unit (ALU)
Accumulator (AC)
ALU Carry Register (C)
Control Unit:
Program Counter (PC)
Address Register (AR)
Instruction Register (IR)
Timing Counter (TC)
Control Logic

Digital Computer Basic Operation;


It consists of a series of instructions cycles, each consisting of;
 Fetch: Fetch instruction from Program Memory (MEM) to Data Register (DR)
 Decode: Pass instruction from DR to Instruction Register (IR) and decode using Control
Logic
 Execute: Perform operations decoded by Control Logic such as,
- Get operands from MEM or Input Register (IN)
- Arithmetic/logic operations
- Store results in MEM or Output Register (OR)

Dlogic101-gen General Introduction


11
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 12

2- Numbers' Systems and Codes


The objective is to be able to explain,
 The difference between analog and digital systems and why digital systems are capable of
greater accuracy.
 The difference between combinational and sequential circuits.
 Why two-valued signals and binary numbers are commonly used in digital systems

Number systems and conversion;


When you complete this chapter, you should be able to solve the following types of problems:
 Given a positive integer, fraction, or mixed number in any base (2 through 16); convert to
any other base. Justify the procedure used by using a power series expansion for the
number.
 Add, subtract, multiply, and divide positive binary numbers. Explain the addition and
subtraction process in terms of carries and borrows.
 Write negative binary numbers in sign and magnitude, 1’s complement, and 2’s
complement forms. Add signed binary numbers using 1’s complement and 2’s
complement arithmetic. Justify the methods used. State when an overflow occurs.
 Represent a decimal number in binary-coded-decimal (BCD), 6-3-1-1 code, excess-3
code, etc. Given a set of weights, construct a weighted code.

Objectives
 Review the decimal number system
 Count in the binary, octal and hexadecimal numbers' systems
 Convert from decimal to binary, octal and hexadecimal and from binary, octal and
hexadecimal to decimal
 Convert between the binary, octal and hexadecimal number systems
 Apply arithmetic operations to binary, octal and hexadecimal numbers
 Determine the 1’s and 2’s complements of a binary number
 Express signed binary numbers in sign-magnitude, 1’s complement, 2’s complement, and
floating-point format
 Carry out arithmetic operations with signed binary numbers
 Express decimal numbers in binary coded decimal (BCD) form Add BCD numbers
 Convert between the binary system, BCD, excess-3 and the Gray codes.
 Interpret the American Standard Code for Information Interchange (ASCII)
 Explain how to detect code errors, and discuss the cyclic redundancy check (CRC)

Dlogic102-num1 Numbers Systems and Codes


12
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 13

2.1 Introductory Background


2.1.1 Motivation
Digital systems have such a prominent role in everyday life that we refer to the present
technological period as the digital age. Digital systems are used in communication, business
transactions, traffic control, spacecraft guidance, medical treatment, weather monitoring, the
Internet, and many other commercial, industrial, and scientific enterprises. We have digital
telephones, digital televisions, digital versatile discs, digital cameras, handheld devices, and
digital computers. We enjoy music downloaded to our portable media player and other
handheld devices having high resolution displays. These devices have graphical user
interfaces (GUIs), which enable them to execute commands that appear to the user to be
simple, but which, in fact, involve precise execution of a sequence of complex internal
instructions. Most, if not all, of these devices have a special-purpose digital computer
embedded within them. The most striking property of the digital computer is its generality. It
can follow a sequence of instructions, called a program that operates on given data. The user
can specify and change the program or the data according to the specific need. Because of this
flexibility, general-purpose digital computers can perform a variety of information-processing
tasks that range over a wide spectrum of applications.

One characteristic of digital systems is their ability to represent and manipulate discrete
elements of information. Any set that is restricted to a finite number of elements contains
discrete information. Examples of discrete sets are the 10 decimal digits, the 26 letters of the
alphabet, the 52 playing cards, and the 64 squares of a chessboard. Early digital computers
were used for numeric computations. In this case, the discrete elements were the digits. From
this application, the term digital computer emerged. Discrete elements of information are
represented in a digital system by physical quantities called signals. Electrical signals such as
voltages and currents are the most common. Electronic devices called transistors predominate
in the circuitry that implements these signals. The signals in most present-day electronic
digital systems use just two discrete values and are therefore said to be binary. A binary digit,
called a bit, has two values: 0 and 1. Discrete elements of information are represented with
groups of bits called binary codes. For example, the decimal digits 0 through 9 are
represented in a digital system with a code of four bits (e.g., the number 7 is represented by
0111). How a pattern of bits is interpreted as a number depends on the code system in which
it resides. To make this distinction, we could write (0111)2 to indicate that the pattern 0111 is
to be interpreted in a binary system, and (0111)10 to indicate that the reference system is
decimal. Then 01112 = 710, which is not the same as 011110, or one hundred eleven. The
subscript indicating the base for interpreting a pattern of bits will be used only when
clarification is needed. Through various techniques, groups of bits can be made to represent
discrete symbols, not necessarily numbers, which are then used to develop the system in a
digital format. Thus, a digital system is a system that manipulates discrete elements of
information represented internally in binary form. In today’s technology, binary systems are
most practical because, as we will see, they can be implemented with electronic components.

Discrete quantities of information either emerge from the nature of the data being processed
or may be quantized from a continuous process. On the one hand, a payroll schedule is an
inherently discrete process that contains employee names, social security numbers, weekly
salaries, income taxes, and so on. An employee’s paycheck is processed by means of discrete
data values such as letters of the alphabet (names), digits (salary), and special symbols (such
as $). On the other hand, a research scientist may observe a continuous process, but record

Dlogic102-num1 Numbers Systems and Codes


13
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 14

only specific quantities in tabular form. The scientist is thus quantizing continuous data,
making each number in his or her table a discrete quantity. In many cases, the quantization of
a process can be performed automatically by an analog-to-digital converter, a device that
forms a digital (discrete) representation of analog (continuous) quantity.

The general-purpose digital computer is the best-known example of a digital system. The
major parts of a computer are a memory unit, a central processing unit, and input–output
units. The memory unit stores programs as well as input, output, and intermediate data. The
central processing unit performs arithmetic and other data-processing operations as specified
by the program. The program and data prepared by a user are transferred into memory by
means of an input device such as a keyboard. An output device, such as a printer, receives the
results of the computations, and the printed results are presented to the user. A digital
computer can accommodate many input and output devices. One very useful device is a
communication unit that provides interaction with other users through the Internet. A digital
computer is a powerful instrument that can perform not only arithmetic computations, but also
logical operations. In addition, it can be programmed to make decisions based on internal and
external conditions.

There are fundamental reasons that commercial products are made with digital circuits. Like a
digital computer, most digital devices are programmable. By changing the program in a
programmable device, the same underlying hardware can be used for many different
applications, thereby allowing its cost of development to be spread across a wider customer
base. Dramatic cost reductions in digital devices have come about because of advances in
digital integrated circuit technology. As the number of transistors that can be put on a piece of
silicon increases to produce complex functions, the cost per unit decreases and digital devices
can be bought at an increasingly reduced price. Equipment built with digital integrated
circuits can perform at a speed of hundreds of millions of operations per second. Digital
systems can be made to operate with extreme reliability by using error-correcting codes. An
example of this strategy is the digital versatile disk (DVD), in which digital information
representing video, audio, and other data is recorded without the loss of a single item. Digital
information on a DVD is recorded in such a way that, by examining the code in each digital
sample before it is played back, any error can be automatically identified and corrected. A
digital system is an interconnection of digital modules. To understand the operation of each
digital module, it is necessary to have a basic knowledge of digital circuits and their logical
function. The first seven chapters of this book present the basic tools of digital design, such as
logic gate structures, combinational and sequential circuits, and programmable logic devices.

2.1.2 Computers and Numbers


Recall that the ALU performs all the arithmetic and logic operations. To achieve this task it is
must be capable of representing the operands as binary digits. For centuries, most civilizations
have performed arithmetic by counting in groups of ten and there are societies that even
today, count differently, but such groups are rare. Speaking about groups of ten means for
example, that one hundred (100) is really ten groups of ten; one thousand is really one
hundred groups of ten or more precisely, ten groups of ten groups of ten; one million would
actually be ten groups of ten groups of ten groups of ten groups of ten groups of ten. For
example;
1 million = 10 × 10 × 10 × 10 × 10 × 10 = 106
oder
1 million = 10( 10( 10( 10( 10( 10) ) ) ) ) = 106
The latter representation illustrates the grouping by tens concept perhaps a bit more clearly.

Dlogic102-num1 Numbers Systems and Codes


14
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 15

As man began to build machines to perform computations, it seemed both natural and logical
to emulate the human way of counting as well as doing arithmetic. When Sir Charles Babbage
built his analytic engine, he devised a series of gears that would mesh with a series of wheels;
each wheel represented a numeric position (units, tens, hundreds, thousands, and so forth),
and each position was engineered to represent any of ten possible digits. This was truly a 10-
state machine. The problem was that the machine’s excessive complexity required a science
of machined parts that was far beyond the capability of extant technology. Nevertheless,
Babbage’s ideas found their way into 20th century adding machines and electric calculators;
definitely NOT the hand held kind though.

Electrically, it was possible to represent each digit by a different voltage level, and some
analog computers successfully used this ploy though serious accuracy was a challenge never
readily solvable. When John Atanasoff created the first electronic digital computer in 1933,
he devised computational circuits around a different concept. His circuits would represent
only two possible states: on and off. This suggested a bivalent system in which only two
values could exist: a value of 1 was assigned to the on state and a value of 0 was used to
represent the off state. What Atanasoff did was make use of what had been previously an
academic concept; performing arithmetic in a numeric base other than ten. In Atanasoff’s
system, arithmetic had to be performed using only two digits (0 and 1). He gave us a practical
use for the binary number system also referred to as the base 2 system.

It turns out that there are an infinite number of number systems, each with its own base. But
before we investigate specific number systems that are used in various aspects of computing,
it will prove worthwhile to discuss the general attributes ascribed to all number systems.

Every number system consists of a group size for counting purposes. This group size is called
the base of the number system. For example, the decimal number system with which we are
most familiar has a base of 10. The binary system described earlier has a base of two. Each
number system consists of a set of digits. Digits are numbered consecutively with zero (0)
always being the first digit in sequence. Each remaining digit is generated by adding one to
the previous digit until the cardinality of the set of digits equals the size of the base. The
cardinality of a set is the number of elements contained in the set. The base number itself is
never a digit. With all number systems, when one is added to the largest digit in the system,
the resulting number consists of a sum of zero and a carry of one. This phenomenon is
represented in the base-ten system as follows:
9
+1
10

In the binary system, we would have 1 + 1 = 10. Note that we have the same two digits for
our summation in each case but in the decimal system, our sum represents the value ten
whereas in binary system, the sum has an equivalent value of two.

One final notion about number systems concerns positional value. Consider the base 10
number 33,333; where each ‘3’ represents a different quantity. The left most ‘3’; also known
as the most significant digit (MSD), represents the value thirty thousand, whereas the ‘3’ on
the right; also known as the least significant digit (LSD), represents the value of three. Note
that in base ten, it appears that the positional values are associated with successive powers of
the base. In fact, every number system has a unit's position, the position located immediately

Dlogic102-num1 Numbers Systems and Codes


15
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 16

to the left of the fraction point. The corresponding power of the base is zero for the units
position and any number raised to the zero power, does yield one from whence the units
position takes its name. As we proceed in the direction of increasing significance (moving left
from the fraction point), the powers increase so that we have a tens position, hundreds
position, thousands position and so forth. The following diagram, Fig. 2.1, illustrates this
idea;

Strictly speaking, 1072 . . . 103 102 101 100


computers are modeled
on the binary or base-2
number system where units
the only permissible tens
digits are 0 and 1. We hundreds
will also discuss the etc. thousands
base-8 (octal) and base- Fig. 2.1
16 (hexadecimal)
number systems because they bear a close relationship to binary and are often used as
shorthand representations of binary numbers.

Numbers' Systems:
Base Digits Radix Examples
Binary (2) 0,1 b or B 10100111B (10100111)2
Octal (8) 0,1,2,3,4,5,6,7 o,O 451057O (451057)8
Decimal (10) 0,1,2,3,4,5,6,7,8,9 d , D , no radix 910456D (910456)10
Hexadecimal (16) 0,1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F h or H A1079CH (A1079C)16

 Number system consists of an ordered set of digits, with relations defined for +, -, * and /.
 The radix (r) or base of a number system indicates the total number of digits allowed in the
number system; common number system includes:
- decimal
- binary
- octal
- hexadecimal

Spatial units of measure used in relation to computer storage capacities:


Unit Symbol Power of 2 Bytes
0
Byte 2 1
Kilobyte KB 210 1,024
20
Megabyte MB 2 1,048,576
30
Gigabyte GB 2 1,073,741,824
Terabyte TB 240 1,099,511,627,776

 28 bytes = 256 bytes = 100H bytes


 10
1 KB = 2 bytes = 1024 bytes = 400H bytes
 64 KB = 216 bytes = 65536 bytes = 10000H bytes
 1 MB = 220 bytes = 1048576 bytes = 100000H bytes
 16 bits (two bytes) is called a word,
 32 bits (four bytes) is called a double word, etc.

Dlogic102-num1 Numbers Systems and Codes


16
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 17

2.1.3 Binary Number System Applications


The most common application for the binary number system can be found in computers'
technology and computerized industrial applications such as robots, CNC (Computer
Numerical Control), etc. All computer languages and programming are based on the 2-digit
number system used in digital encoding. Digital encoding is the process of capturing data and
representing it with discreet bits of information. These discreet bits consist of the 0s and 1s of
the binary system. For example, the images you see on your computer screen have been
encoded with a binary line for each pixel. If a screen is using a 16-bit code, then each pixel
has been told what color to display based on which bits are 0s and which bits are 1s. As a
result, 216 represent 65,536 different colors. Also, the binary number system can be found in a
branch of mathematics known as Boolean algebra. This field of mathematics is concerned
with logic and truth values. Here, statements that are either true or false are then assigned a 0
or 1. Alternatively, concerning electricity, 0 can be defined as any voltage less than 2V, and 1
as any voltage greater than 4V. Then we can use these values to control things and do
additional calculations, in pretty much the same way you do calculations with decimal
numbers.

Dlogic102-num1 Numbers Systems and Codes


17
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 18

2.2 Decimal (Base-10) Numbers


Decimal numbers use the digits 0-9 and powers of 10, where the position of each digit in a
weighted number system is assigned a weight based on the base or radix of the system. The
radix of decimal numbers is ten (10), because only ten digits (0 through 9) are used to
represent any number. The column weights of decimal numbers are powers of ten that
increase from right to left beginning with 100 =1; e.g.
…105 104 103 102 101 100

For fractional decimal numbers, the column weights are negative powers of ten that decrease
from left to right: e.g.
102 101 100. 10-1 10-2 10-3 10-4 …

The value of a decimal number can be calculated by multiplying the digit by the value of each
place and adding the results for each digit. The value of each place is determined by the
powers of 10 starting at 0 (10 to the 0th power is 1) and increasing from right to left.

Thus, decimal numbers can be expressed as the sum of the products of each digit times the
column value for that digit as follows;
 (9240) = (9 x 103) + (2 x 102) + (4 x 101) + (0 x 100)
or
 (9240) = 9 x 1000 + 2 x 100 + 4 x 10 + 0 x 1

 321 = 1 * 1 (10 to the power 0) + 2 * 10 (10 to the 1st power) + 3 * 100 (10 to the 2nd power)
= 1 + 20 + 300 = 321.
100’s place 10’s place 1’s place
3 2 1
321 = 300 + 20 + 1 = 321.

Example-2.2.1: Discuss the number 3027D (302710)


 302710 :
‒ The 7 is in the 1s position and is equal to 7 x 100, or simply 7 x 1;
‒ the 2 is in the 10s position and is equal to 2 x 101, or 20;
‒ the 0 is in the 100s position and is equal to 0 x 102, or 0 x 100; and
‒ the 3 is in the 1000s position and is equal to 3 x 103, or 3 x 1000.
 Note that starting on the right, the powers start at 0 and increment by 1 for every place
moving to the left.

Example-2.2.2:
Consider the number 257.56, where each digit has a value of 0 through 9 and has a place
value; Express the number as the sum of values of each digit.

Solution:
257.76  2  10 2  5  101  7  10 0  7  10 1  6  10 2
 200  50 7  0.7  0.06

Dlogic102-num1 Numbers Systems and Codes


18
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 19

Example-2.2.3:
Multiplier x100000 x10000 x1000 x100 x10 x1
Digits 2 3 1 4 6 7
Most Significant Bit Least Significant Bit
(MSB) (LSB)
In the decimal system (base 10), you should be able to see that each part of the number
increases in multiples of ten. The least significant part is that which has the lowest value in
this case 7 units, and the most significant part is the value of the highest multiple, in this case
200000.

2.3 Binary (Base-2) Numbers


Binary numbers use the digits 0-1 and powers of 2, where the Binary number system is called
Base 2 because there are only two numbers (0 and 1) that make up its set of digits. Binary
numbers are the language of electricity, where a 1 = voltage and a 0 = no voltage. More
precisely, a value of ‘1’ is represented by a
“high” voltage, generally 3-5 volts while a value
of ‘0’ is represented by a “low” voltage, Number of 1’s or units
normally 0-2 volts. Actually, these binary digits Number of 2’s
(called bits for short) are the only numeric forms Number of 4’s
a computer can recognize and is the state by Number of 8’s
which all data is moved within a computer. The Number of 16’s
relative ordering of the digits correspond to Fig. 2.2: Successive powers of two
successive powers of two is shown in Fig. 2.2.

For digital systems, the binary number system is used which has a radix of two and uses the
digits 0 and 1 to represent quantities. The column weights of binary numbers are powers of
two that increase from right to left beginning with 20 =1; e.g.
…25 24 23 22 21 20

For fractional binary numbers, the column weights are negative powers of two that decrease
from left to right:
22 21 20. 2-1 2-2 2-3 2-4… Dec Binary Number
0 0 0 0 0 0
A binary counting sequence for numbers from zero to 1 0 0 0 0 1
fifteen contains pattern of zeros and ones in each column 2 0 0 0 1 0
3 0 0 0 1 1
as shown in the following table:
4 0 0 1 0 0
5 0 0 1 0 1
The decimal value of a binary number can be calculated by 6 0 0 1 1 0
multiplying the digit by the value of each place and adding 7 0 0 1 1 1
the results for each digit. 8 0 1 0 0 0
9 0 1 0 0 1
The value of each place is determined by the powers of 2 10 0 1 0 1 0
11 0 1 0 1 1
starting at 0 (2 to the 0th power is 1) and increasing from
12 0 1 1 0 0
right to left. 13 0 1 1 0 1
14 0 1 1 1 0
15 0 1 1 1 1
16 1 0 0 0 0

Dlogic102-num1 Numbers Systems and Codes


19
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 20

For example;
 111 = 1 * 1 (2 to the power 0) + 1 * 2 (2 to the power 1) + 1 * 4 (2 to the power 2).
4’s place 2’s place 1’s place
1 1 1
(111)2 = 4 + 2 + 1 = (7)10

As the above table indicates, we can count in binary just as readily as we can count in decimal
but simply needs more digits to represent the
same quantities. Digital counters frequently have
this same pattern of digits. Binary Numbers has;
 Base or radix 2 number system,
 Binary digit is called a bit, and
 Numbers are 0 and 1 only.
Thus, numbers can be expressed in powers of 2
as follows:
213 212 211 210 29 28 27 26 25 24 23 22 21 20
8192 4096 2048 1024 512 256 128 64 32 16 8 4 2 1

Bits in computer memory are organized into bytes; each byte has 8 bits. The first 8 values in
powers of 2 are 1, 2, 4, 8, 16, 32, 64, 128. So you can store the values 0 to 255 in 1 byte (8
bits).

Example-2.3.1:
128 64 32 16 8 4 2 1
1 1 1 1 1 1 1 1
 (1111 1111)2 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (255)10.

128 64 32 16 8 4 2 1
0 1 0 0 1 0 1 1
 (0100 1011)2 = 64 + 8 + 2 + 1 = (75)10

Example-2.3.2:
Consider the number (1011.0011) in base-2, show its representation as a decimal number.

Solution:
 
(1011.0011) 2  (1  2 3  0  2 2  1  21  1  2 0 )  (0  2 1  0  2 2  1  2 3  1  2 4 ) 10
 (11.1875)10

To convert from decimal to binary use the greedy algorithm: Start with the first power of two
less than or equal to the decimal number and turn that bit to 1. Then subtract the power of two
from the decimal number and continue until done. To convert 9 to binary start by using 1 for
the 8’s place and then (9 – 8) is 1 so use the 1 in the 1’s place, i.e.
(9)10 = (1001)2

Dlogic102-num1 Numbers Systems and Codes


20
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 21

2.4 Octal (Base 8) Numbers


The octal number system (or base 8 number system) uses the digits 0-7 and powers of 8 to
represent all numbers. It turns out that groups of three binary digits will represent any octal
digit since binary 000 – 111 correspond to the values 0 – 7. Computer programmers made use
of the octal number system in the late 1940s to make it easier to remember long strings of
binary numbers. At that time, computers were still programmed in machine language, which
was a straight binary language. There was no assembler language and certain languages like
COBOL and FORTRAN were not even being thought about. In fact, both instructions and
data were loaded into the computer’s memory by flipping toggle switches up or down to
signify values of one and zero respectively. It seemed natural to one bright soul that the eight
3-binary digit patterns could be mapped to the digits 0 through 7. A simple substitution code
was born and programmers quickly learned that they could translate something easy to
remember like 31246 into the binary string 011001010100110. This simple substitution code
became the first simplification to programming language use. The fact that the substitution
patterns exactly portrayed the base 8 (octal)
number system was likely not the intent of
these early programmers. It just happened to Number of 1’s or units
turn out that way. The octal number system Number of 8’s
consists of the digits 0, 1, 2, 3, 4, 5, 6, 7 as Number of 64’s
mentioned previously; and like the binary and Number of 512’s
Number of 4096’s
decimal systems, base 8 numbers have
position values associated with each digit in a Fig. 2.3
number as shown in Fig. 2.3.
Dec Binary Number Octal
For example, the octal number (32467)8 consists of the 0 0 0 0 0 0 0
following: 1 0 0 0 0 1 1
7 units 2 0 0 0 1 0 2
6 eights 3 0 0 0 1 1 3
4 sixty-fours 4 0 0 1 0 0 4
2 five hundred twelves 5 0 0 1 0 1 5
3 four thousand ninety-sixes 6 0 0 1 1 0 6
7 0 0 1 1 1 7
Octal uses eight characters to represent the numbers 0 8 0 1 0 0 0 10
through 7 and there is no 8 or 9 character in octal. Octal is 9 0 1 0 0 1 11
a weighted number system where the column weights are 10 0 1 0 1 0 12
powers of 8, which increase from right to left beginning 11 0 1 0 1 1 13
with 80 =1; e.g.; 12 0 1 1 0 0 14
83 82 81 80 13 0 1 1 0 1 15
14 0 1 1 1 0 16
For fractional octal numbers, the column weights are
15 0 1 1 1 1 17
negative powers of 8 that decrease from left to right:
16 1 0 0 0 0 20
82 81 80. 8-1 8-2 8-3 8-4…
 Base or radix 8 number system
 1 octal digit is equivalent to 3 bits.
 Numbers are 0-7.
 Numbers are expressed as powers of 8. 80 = 1, 81 = 8, 82 = 64, 83 = 512, 84 = 4096.

Dlogic102-num1 Numbers Systems and Codes


21
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 22

Example-2.4.1:
 (32)8 = 2 * 1 + 3 * 8 = 2 + 24 = (26)10
64’s place 8’s place 1’s place
0 3 2

 (110)8 = 0*1 + 1 * 8 + 1 * 64 = (72)10


64’s place 8’s place 1’s place
1 1 0

Example-2.4.2:
Express the number (1526.76)8 as the sum of values of each digit.

Solution:
Start by writing the column weights:

(1526.76)8 = (1 x 83) + (5 x 82) + (2 x 81) + (6 x 80) + (7 x 8-1) + (6 x 8-2)

2.5 Hexadecimal (Base-16) Numbers


In addition to using powers of 16, the hexadecimal (base 16) number system requires sixteen
digits; the first 10-digits are represented by 0-9 while the remaining six digits are represented
by A for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. Of course, other symbols
could have been chosen just as easily, but the letters were and are now part of a standard
notational form. Besides, we could not have permitted ‘10’ to follow ‘9’ because ‘10’ is
actually two separate symbols. Hexadecimal numbers look weird and they demand a bit more
concentration if we are to work with them readily. Groups of four binary digits can be used to
represent Hexadecimal numbers since binary 0000-1111 represents constitutes a range of
sixteen different values. Computers use the hexadecimal number system in ways that parallel
the use of octal numbers.

Prior to 1963, every computer that was programmed to manipulate characters used a special
6-bit code called BCD (Binary Coded Decimal) to represent numeric digits, upper case letters
of the alphabet, and a variety of grammatical and arithmetic punctuation marks and symbols.
This set of codes representing sixty-four characters could not be expanded to handle lower
case letters. IBM engineers solved the problem by creating the framework for an 8-bit code
called EBCDIC (Extended Binary Coded Decimal Interchange Code). It was a
straightforward conversion to describe these 8-bit binary strings by two hexadecimal digits.
Thus, for example, the bit pattern 1001 1100 translated directly into 9C in which the ‘9’
represented ‘1001’ and ‘C’ corresponded to the string ‘1100’; a simple substitution. IBM
unveiled this new system for its System 360 (later 370) family of computers and the use of
“hex” codes became fairly common.

For reasons too lengthy to discuss here, the Number of 1’s or units
Federal Government chose not to adopt IBM’s Number of 16’s
character code as a national standard, despite Number of 256’s
the fact that most computers in use at that Number of 4096’s
time followed the EBCDIC de facto standard. Number of 65536’s
Instead, the American National Standards Fig. 2.4
Institute (then known as ANSI but later
renamed as the National Institute of Standards and Technology (NIST)), part of the Bureau of

Dlogic102-num1 Numbers Systems and Codes


22
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 23

Standards, developed in conjunction with the electronics and telecommunications industries


as a whole, the now standard ASCII character codes. Even though the meanings of the bit
patterns are different, accustomed usage has caused the hexadecimal codes to remain with us
as easy ways to recall large strings of binary data. Below are representations of both the base
16 positional values and the Base 16 equivalencies.

Hexadecimal
 Base or radix 16 number system
 1 hex digit is equivalent to 4 bits.
 Numbers are 0-9, A, B, C, D, E, and F.
 (A)16 = (10)10, (B)16 = (11)10, (C)16 = (12)10, (D)16 = (13)10, (E)16 = (14)10, (F)16 = (15)10
 Numbers are expressed as powers of 16.
 160 = 1, 161 = 16, 162 = 256, 163 = 4096, 164 = 65536, …

Thus the hexadecimal number (2B4F)16 consists of


15 units
4 sixteens
11 two hundred fifty-sixes
2 four thousand ninety-sixes
Weights
16 8 4 2 1
Dec Binary Number Hexadecimal
0 0 0 0 0 0 0
1 0 0 0 0 1 1
2 0 0 0 1 0 2
3 0 0 0 1 1 3
4 0 0 1 0 0 4
5 0 0 1 0 1 5
6 0 0 1 1 0 6
7 0 0 1 1 1 7
8 0 1 0 0 0 8
9 0 1 0 0 1 9
10 0 1 0 1 0 A
11 0 1 0 1 1 B
12 0 1 1 0 0 C
13 0 1 1 0 1 D
14 0 1 1 1 0 E
15 0 1 1 1 1 F
16 1 0 0 0 0 10

Hexadecimal uses sixteen characters to represent numbers: the numbers 0 through 9 and the
alphabetic characters A through F. Hexadecimal is a weighted number system where the
column weights are powers of 16, which increase from right to left beginning with 16 0 =1;
e.g.; 163 162 161 160

For fractional hexadecimal numbers, the column weights are negative powers of 16 that
decrease from left to right: 162 161 160. 16-1 16-2 16-3 16-4…

Dlogic102-num1 Numbers Systems and Codes


23
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 24

Example-2.5.1:
 (A7)16 = A * 16 + 7 * 1 = 10 * 16 + 7 * 1 = 160 + 7 = (167)10

256’s place 16’s place 1’s place


0 A 7

 (110)16 = 1 * 256 + 1 * 16 + 0 * 1 = 10 * 16 + 7 * 1 = 256 + 16 + 0 = (272)10

Example-2.5.2:
Express the number (1A2F.B6)16 as the sum of values of each digit.

Solution:
Start by writing the column weights:

(1A2F.B6)16 = (1 x 163) + (A x 162) + (2 x 161) + (F x 160) + (B x 16-1) + (6 x 16-2)


= (1 x 163) + (10 x 162) + (2 x 161) + (15 x 160) + (11 x 16-1) + (6 x 16-2)

Colors are made up of red, green, and blue values from 0 – 255 (8 bits). You can specify the
amount of red, green, and blue using 2 digit hexadecimal numbers (00 is 0 and FF is 255).

2.6 Numbers' Conversions


Conversions from Binary to hexadecimal/octal and hexadecimal/octal to binary are
straightforward.

An unsigned or a positive integer in base b with n digits: (d n - 1dn -2 . . . d2d1d0) has the
decimal (base 10) value:
 n 1 
d n 1 * b n 1  d n 1 * b n 1  d n  2 * b n  2  ......  d 2 * b 2  d 1 * b1  d 0 * b 0   d i * b i 
 i 0 10
where all the arithmetic is done in base 10.

To convert an unsigned or a positive decimal number to base b; repeatedly divide the number
and then each succeeding quotient by b until a quotient of zero is obtained. The remainders
from the last to the first; but converted to base b, form the required number. An appropriate
number of leading zeroes is prefixed to obtain the required number of bits.

Conversion between Bases: In general, conversion between bases can be done via the
following diagram: Base-2
Base-2

Base-3 Base-3
 Base r  Decimal Decimal
. .
‒ Weighted position notation for integer . .
and fraction
 Decimal  Base r Base-r Base-r
- Integer number: repeated division by r Fig. 2.5: Numbers' Conversion
- fractions: repeated multiplication by r

Dlogic102-num1 Numbers Systems and Codes


24
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 25

2.6.1 Decimal Conversions


You can convert a decimal to any other base (2, 8, 16) by repeatedly dividing by that base. In
addition, a decimal fraction can be converted to other base (2, 8, 16) by repeatedly
multiplying the fractional results of successive multiplications by the other base (2, 8, 16).

Example-2.6.1:
Convert the decimal number (49.188) into binary.
Solution:
 The decimal number 49: the column weights double in each position to the right, thus
write down column weights until the last number is larger than the one you want to
convert;
26 25 24 23 22 21 20.
64 32 16 8 4 2 1.
0 1 1 0 0 0 1.

 Or convert the decimal number 49 to


binary by repeatedly dividing by 2;
You can do this by “reverse
division” and the answer will
read from left to right. Put
quotients to the left and Fig. 2.6
remainders on top

 Convert the decimal fraction (.188) to binary by repeatedly multiplying the fractional
results of successive multiplications by 2 as follows;
0.188 x 2 = 0.376 carry = 0 (MSB)
0.376 x 2 = 0.752 carry = 0
0.752 x 2 = 1.504 carry = 1
0.504 x 2 = 1.008 carry = 1
0.008 x 2 = 0.016 carry = 0 (LSB)
Answer = .00110 (for five significant digits)

Converting from decimal to binary is carried out using a simple paper and pencil method
where the decimal number is taken and repeatedly divide it by 2, keeping track of the integer
remainder.

Example-2.6.2: let's convert the decimal value (57) to binary using this method;
____
2 ) 57
28 with a remainder of 1 (now divide 28 by 2)
14 with a remainder of 0
7 with a remainder of 0
3 with a remainder of 1
1 with a remainder of 1
0 with a remainder of 1.
Now take all the remainders starting with the last one and write your binary number:
(1 1 1 0 0 1)2

Converting from Decimal (base 10) to Binary (base 2) begins by dividing the decimal number
by the binary base number (2) using the division algorithm. This division will produce an

Dlogic102-num1 Numbers Systems and Codes


25
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 26

integer quotient and an integer remainder of either 1 or 0. Note that the use of integer
remainders is frequently called modulo division. If the quotient is evenly divisible by the base
number, use 0 as the remainder. Otherwise, the remainder will be the digit 1. The next step
will require dividing the new quotient by the base number again to find yet another quotient
and a remainder. Continue with this process, recording the remainders in order, and writing
them from right to left order until you produce a zero with a corresponding remainder of one.
This is the last remainder to record. The equivalent number in the new base is the string of
integer remainders recorded.

Example-2.6.3:
Convert the number (6)10 into binary,
LSB MSB Shorthand Method
3 1 0  6 ÷ 2 = 3 R 0 LSD
2 6 2 3 2 1  3÷2=1R1
 1 ÷ 2 = 0 R 1 MSD
6 2 2
0 1 1
 (6)10 = (110)2

The shorthand method is presented because many find it convenient to express divisions by
two in this manner. If the method makes you uncomfortable, then by all means follow
standard long division practices. Now let’s try a more complicated problem. For example;
convert (274)10 to its binary (base 2) equivalent;
Shorthand Method
274 ÷ 2 = 137 R 0 LSD
137 ÷ 2 = 68 R 1 8÷2=4R0
68 ÷ 2 = 34 R 0 4÷2=2R0
34 ÷ 2 = 17 R 0 2÷2=1R0
17 ÷ 2 = 8 R 1 1 ÷ 2 = 0 R 1 MSD
continue
(274)10 = (100010010)2

Example-2.6.4:
Convert (51)10 to binary
 51  2 = 25 remainder is 1
 25  2 = 12 remainder is 1
 12  2 = 6 remainder is 0
 6  2 = 3 remainder is 0
 3  2 = 1 remainder is 1
 1  2 = 0 remainder is 1

Answer = 1 1 0 0 1 1

The answer is read from bottom (MSB) to top (LSB) as (110011) 2

Dlogic102-num1 Numbers Systems and Codes


26
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 27

Example-2.6.5:
Convert a decimal number (11.1875) into a binary number.

First, look at the integer part: 11;


1. Divide 11 by 2; this gives a quotient of 5 and a remainder of 1. Since the remainder is 1,
a0  1 .
2. Divide the quotient 5 by 2; This gives a quotient of 2 and a remainder of 1. Since the
remainder is 1, a1  1 .
3. Divide the quotient 2 by 2; This gives a quotient of 1 and a remainder of 0. Since the
remainder is 0, a2  0 .
4. Divide the quotient 1 by 2; This gives a quotient of 0 and a remainder of 1. Since the
remainder is , a3  1 .
Since the quotient now is 0, the process is stopped and the above steps are summarized in the
following table:
Converting a base-10 integer to binary representation
Quotient Remainder
11/2 5 1  a0
5/2 2 1  a1
2/2 1 0  a2
1/2 0 1  a3
Hence
(11)10  (a3 a2 a1a0 ) 2
 (1011) 2
For any integer, the algorithm for finding the binary equivalent is given in the flowchart
shown in Fig. 2.7a.

Now let us look at the decimal part, that is, 0.1875;


 Multiply 0.1875 by 2. This gives 0.375. The number before the decimal is 0 and the number after the
decimal is 0.375. Since the number before the decimal is 0, a1  0 .
 Multiply the number after the decimal, that is, 0.375 by 2. This gives 0.75. The number before the decimal
is 0 and the number after the decimal is 0.75. Since the number before the decimal is 0, a2  0 .
 Multiply the number after the decimal, that is, 0.75 by 2. This gives 1.5. The number before the decimal is
1 and the number after the decimal is 0.5. Since the number before the decimal is 1, a 3  1 .
 Multiply the number after the decimal, that is, 0.5 by 2. This gives 1.0. The number before the decimal is 1
and the number after the decimal is 0. Since the number before the decimal is 1, a4  1 .
Since the number after the decimal is 0, the conversion is complete and the above steps are
summarized in Table 2.

Table 2: Converting a base-10 fraction to binary representation


Number Number after decimal Number before decimal
0.1875  2 0.375 0.375 0  a1
0.375  2 0.75 0.75 0  a 2
0.75  2 1.5 0.5 1  a 3
0.5  2 1.0 0.0 1  a4

Dlogic102-num1 Numbers Systems and Codes


27
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 28

Hence
(0.1875)10  (a1a 2 a3a 4 ) 2
 (0.0011) 2
The algorithm for any fraction is given in a flowchart shown in Fig. 2.7b.

Having calculated
(11)10  (1011) 2
and
(0.1875)10  (0.0011) 2 ,
we have
(11.1875)10  (1011.0011) 2 .

Start

Integer N to be
Input (N)10 converted to
binary format

i=0

Divide N by 2 to get the


quotient Q & remainder R

i = i+1 ai = R

No
is Q = 0?

Yes

n=i
(N)10 = (an. . .a0)2

STOP

Fig. 2.7a: Integer Conversion

Dlogic102-num1 Numbers Systems and Codes


28
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 29

Start

Fraction F to
Input (F)10
be converted to
binary format

i  1

Multiply F by 2 to get the


number before decimal, S
and after decimal, T

i  i 1 ai = R

No
is T = 0?

Yes

n=i
(F)10 = (a-1. . .a-n)2

STOP

Fig. 2.7b: Fraction Conversion

In the above example, when we were converting the fractional part of the number, we were
left with 0 after the decimal number and used that as a place to stop. In many cases, we are
never left with a 0 after the decimal number. For example, finding the binary equivalent of 0.3
is summarized in Table 3.

Table 3: Converting a base-10 fraction to approximate binary representation


Number Number after decimal Number before decimal
0.3  2 0.6 0.6 0  a1
0.6  2 1.2 0.2 1  a2
0.2  2 0.4 0.4 0  a 3
0.4  2 0.8 0.8 0  a 4
0.8  2 1.6 0.6 1  a 5
As you can see the process will never end, in which case, the number can only be
approximated in binary format, that is,
(0.3)10  (a 1a  2 a 3a  4 a 5 ) 2  (0.01001) 2

Dlogic102-num1 Numbers Systems and Codes


29
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 30

The mathematics behinds this process of converting a decimal number to binary format can
be illustrated as follows:
Let z be the decimal number written as
z  x. y
where
x is the integer part and y is the fractional part.

To find the binary equivalent of x ; it can be written as


x  a n 2 n  a n 1 2 n 1  ...  a 0 2 0
If we can now find a0 ,. . ., a n in the above equation then
( x)10  (an an1 . . .a0 ) 2

To find the binary equivalent of y , it can be written as


y  b1 2 1  b 2 2 2  ...  b m 2  m
If we can now find b1 ,. . ., bm in the above equation then
( y)10  (b1b2 . . .bm ) 2

Let us look at this using the same example as before.

Example-2.6.6
Convert (11.1875)10 to base 2.

Solution
To convert (11)10 to base 2, what is the highest power of 2 that is part of 11. That power is 3,
as 2 3  8 to give
11  2 3  3
What is the highest power of 2 that is part of 3. That power is 1, as 21  2 to give
3  21  1
So
11  2 3  3  2 3  21  1
What is the highest power of 2 that is part of 1. That power is 0, as 2 0  1 to give
1  20
Hence
(11)10  2 3  21  1  2 3  21  2 0  1  2 3  0  2 2  1  21  1  2 0  (1011) 2

To convert (0.1875)10 to the base 2, we proceed as follows. What is the smallest negative
power of 2 that is less than or equal to 0.1875. That power is  3 as 23  0.125 .
So
0.1875  23  0.0625
What is the next smallest negative power of 2 that is less than or equal to 0.0625. That power
is  4 as 2 4  0.0625 .
So
0.1875  23  24
Hence

Dlogic102-num1 Numbers Systems and Codes


30
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 31

(0.1875)10  2 3  0.0625  2 3  2 4  0  2 1  0  2 2  1  2 3  1  2 4  (0.0011) 2

Since (11)10  (1011) 2 and (0.1875)10  (0.0011) 2 we get


(11.1875)10  (1011.0011) 2

Example-2.6.7
Convert (13.875)10 to base 2.

Solution
For (13)10 , conversion to binary format is shown in Table 4.

Table 4: Conversion of base-10 integer to binary format


Quotient Remainder
13/2 6 1  a0
6/2 3 0  a1
3/2 1 1  a2
1/2 0 1  a3
So
(13)10  (1101)2

Conversion of (0.875)10 to binary format is shown in Table 5.

Table 5: Converting a base-10 fraction to binary representation


Number after Number before
Number
decimal decimal
0.875  2 1.75 0.75 1  a1
0.75  2 1.5 0.5 1  a 2
0.5  2 1.0 0.0 1  a3
So
(0.875)10  (0.111) 2
Hence
(13.875)10  (1101.111)2

You can also convert decimal to hexadecimal in a similar fashion (repeatedly divide by 16
and keep track of the integer remainders) but it might be easier to convert the decimal number
to binary first, then simply convert the binary number to hexadecimal.

Example-2.6.8:
Convert (77)10 to hex

77  16 = 4 remainder is D
4  16 = 0 remainder is 4
The answer is read from bottom to top as (4D) 16, the same as with the binary case.

Dlogic102-num1 Numbers Systems and Codes


31
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 32

Example-2.6.9: Convert 123 into binary.

2 123  62 remainder 1

2 62  31 remainder 0

2 31  15 remainder 1

2 15  7 remainder 1

2 7  3 remainder 1

2 3  1 remainder 1

2 1  0 remainder 1
Then the required binary number is taken from the remainder values written down at the end
of each division as;
Binary number = 1 1 1 1 1 0 1
Therefore 12310 = 11111012
Another method of conversion is the successive subtraction of the powers of 2, which sounds
very grand but in reality is just about subtracting the largest multiple of 2 away from the
number to convert, and then continuing to subtract the next highest multiple until you reach 0.

Example-2.6.10: Convert 20110 into binary.


256 128 64 32 16 8 4 2 1

Starting with the highest multiple of 256; the number to be converted is less than this so we cannot
subtract 256 from it, so we enter a 0 in this column.
256 128 64 32 16 8 4 2 1
0
The next multiplier is 128 which we can subtract, so we put a 1 in this column.
256 128 64 32 16 8 4 2 1
0 1
We now have 201-128 = 73 left, our next multiple is 64 which we can again subtract so we place a 1
in this column.
256 128 64 32 16 8 4 2 1
0 1 1
We now have 73-64 = 9 left, so we cannot subtract 32, or 16, but we can subtract 8, so the table now
looks like:
256 128 64 32 16 8 4 2 1
0 1 1 0 0 1
We are left with 9 – 8 = 1, and so it is not possible to subtract 4 or 2 but we need to subtract the last 1,
so the full table becomes:
256 128 64 32 16 8 4 2 1
0 1 1 0 0 1 0 0 1

Therefore 20110 = 0110010012

Dlogic102-num1 Numbers Systems and Codes


32
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 33

2.6.2 Binary Conversions


The decimal equivalent of a binary number can be determined by adding the column values of
all of the bits that are 1 and discarding all of the bits that are 0. Converting from Binary (base
2) to Decimal (base 10) begins by determining the position values for each digit in the base
number to convert and then using the multiplication algorithm. Start with the right-most
position and apply the base number to the power of 0, the next position to the left would apply
the base number to the power of 1, and so forth. Next, multiply each integer in the base 2
number by its corresponding positional value. Lastly, sum all of the products; the summation
is the base 10 equivalent of the binary number.

Binary into Decimal

Example-2.6.11
Convert the binary number (100101.01)2 to decimal.

Solution:
Start by writing the column weights; then add the weights that correspond to each 1 in the
number.
25 24 23 22 21 20 . 2-1 2-2
32 16 8 4 2 1 . ½ ¼
1 0 0 1 0 1.0 1
32 + 4 + 1 + ¼ = 37¼

Example-2.6.12
 The binary number (10010)2 is equal to (starting from the left) 16 + 0 + 0 + 2 + 0, or 18
in decimal.
 The binary number (1011101)2 is equal to 64 + 0 + 16 + 8 + 4 + 0 + 1, or 93 in decimal.

Example-2.6.13
Consider the example below, (11101)2
1 1 1 0 1 Beginning Integers
4 3 2 1 0
2 2 2 2 2 Base to positional powers
16 8 4 2 1 Multiples of base number
1x16 1x8 1x4 0x2 1x1 Multiply position’s digit by the multiple of the base number
16 8 4 0 1 Add products to find base 10 Equivalent = 2910
Then, (11101)2 is equivalent to (29)10.

Example-2.6.14
A more complex example, convert (11000111010101)2 to its decimal equivalent;

In this case, working from right to left on the binary number, you will need to sum the
following: (1 + 0 + 4 + 0 + 16 + 0 + 64 + 128 + 256 + 0 + 0 + 0 + 4096 + 8192) to obtain the
correct decimal equivalent value of (12757)10.

Dlogic102-num1 Numbers Systems and Codes


33
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 34

Example-2.6.15
Convert the binary number (110011)2 to decimal.
1 1 0 0 1 1 Beginning Integers
25 24 23 22 21 20 Base to positional powers
32 16 8 4 2 1 Multiples of base number
1x32 1x16 0x8 0x4 1x2 1x1 Multiply position’s digit by the multiple of the base number
32 16 0 0 2 1 Add products to find base 10 Equivalent = 5110
Then, (110011)2 is equivalent to (51)10.

Alternatively, the successive process is reversed; for the binary number to be converted we
must add together all of the multipliers where there is a corresponding 1 in the binary.

Example-2.6.16: Convert (10011001)2 into decimal.

You start with a simple grid as we used before, in this case only 8 cells are needed.
128 64 32 16 8 4 2 1

Fill in the binary number.


128 64 32 16 8 4 2 1
1 0 0 1 1 0 0 1
Add together all multipliers where binary number is a 1 i.e. 128+16+8+1 = 153.
Therefore 100110012 = 15310.

Binary into Octal


Converting from binary (base 2) to octal (base 8) begins simply by arranging the binary digits
into groups of three (triplets). If the total number of binary digits is not divisible by three,
leading zeros may be added. It is important to remember to begin grouping from the least
significant bit towards the most significant bit. Next, each triplet is converted to the octal
number equivalent according to the coding system previously described. Recall that the range
of equivalencies is from 0 (000) to 7 (111). This process is referred to as 3-bit substitution
code. Binary number can easily be converted to octal by grouping 3-bits at a time and writing
the equivalent octal character for each group.

Example-2.6.17
Express (1 001 011 000 001 110)2 in octal:
Group the binary number by 3-bits starting from the right yields;
(1 001 011 000 001 110)2 = (001 001 011 000 001 110)2 = (113016)8

The conversion from octal to binary is a simple process reversal that begins by converting the
most significant octal digit (left most digit) to its binary equivalent. Repeat the conversion
with each octal number, working your way towards the least significant digit (right most
digit). After converting each octal number, concatenate all binary numbers together.

Dlogic102-num1 Numbers Systems and Codes


34
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 35

Example-2.6.18
Convert (6132)8 into binary
MSB LSB
6 = 110 1 = 001 3 = 011 2 = 010

(110 001 011 010)2


 (6132)8 = (110001011010)2.

Also,
(613.2)8 = (110 001 011.010)2

Group the binary numbers into triplets beginning at the binary point and working outward in
both directions. If the number of binary digits is not divisible by three, leading or trailing
zeros may be added at either end without altering the value of the number to be converted.
Next, each triplet is replaced by its octal equivalent.

Example-2.6.19
Convert (1100110.10)2 into Octal;
(1100110.10)2 = (001 100 110.100)2 = (146.4)8

Binary into Hexadecimal


Converting from binary to hexadecimal (base 16) is an identical procedure to that used for
converting from binary to octal except that we use the 4-bit substitution code instead of the 3-
bit one. The procedure begins simply by arranging our binary number into groups of four bits.
If the number of binary digits is not divisible by four, leading zeros may be added. Next, each
group of four binary digits is converted to a corresponding hexadecimal digit. Recall that
these hex digits range from 0 (0000) to F (1111). This process is referred to as the 4-bit
substitution code.

Group the binary numbers into fours beginning at the binary point and working outward in
both directions. If the number of binary digits is not divisible by four, leading or trailing zeros
may be added at either end. Next, each group of four binary digits is converted to its
corresponding hexadecimal digit that, as previously noted, ranges from 0 (0000) to F (1111).

Binary number can easily be converted to hexadecimal by grouping the binary number in
groups of 4-bits at a time and writing the equivalent hexadecimal character for each group;

Example-2.6.20
Express (1 001 011 000 001 110.011 11)2 in hexadecimal:

Group the binary number by 4-bits starting from the right yields;
(1 001 011 000 001 110.011 11)2 = (1001 0110 0000 1110 . 0111 1000)2 = (960E.78)16

Another example, the binary value


(111 1000 1010 1001 0011 0101 1100)2

Equals ( 7 8 A 9 3 5 C) 16

Dlogic102-num1 Numbers Systems and Codes


35
G.A. El-Sheikh Digital Logic Design I: Devices and Circuits 36

The conversion from hexadecimal to binary again is similar to the previously explained octal
to binary conversion. Simply replace each digit to the left and right of the fraction point with
its 4-bit binary equivalent. The process begins by converting the most significant hex digit to
its binary equivalent. We repeat the conversion with each successive digit, working our way
towards the least significant digit. After converting each hexadecimal digit to its 4-digit
binary counterpart, we merge all binary digits together to obtain our answer. That is, after
converting each hexadecimal digit, concatenate all the binary digits separated by a binary
point positioned appropriately.

Example-2.6.21
Convert (395F.4B)16 into binary

MSB LSB
3 = 0011 9 = 1001 5 = 0101 F = 1111 . 4 = 0100 B = 1011

(0011 1001 0101 1111 . 0100 1011)2


 (395F.4B)16 = (0011 1001 0101 1111. 0100 1011)2

2.6.3 Octal Conversions


Decimal and Octal Conversion
Converting a decimal number (base 10) to octal (base 8) begins by dividing the decimal
number by eight, the octal base number. This will yield an integer quotient and a remainder
that ranges between zero and seven. This modulo division is identical to that used to convert
decimal numbers into binary. Note that the remainder will be one of the octal digits. The next
step requires us to divide the new quotient by eight again to find yet another quotient and
remainder. Continue with this process, recording the remainders in order, writing them from
right to the left until the last quotient is zero. At this point, the last remainder is the most
significant digit of the base 8 number. The equivalent number in the new base is the string of
integer remainders recorded.

Example-2.6.22:
Convert (161)10 into Octal
LSB MSB Shorthand Method
20 2 0  161 ÷ 8 = 20 R 1 LSD
8 161 8 20 8 2  20 ÷ 8 = 2 R4
 2÷8=0 R 2 MSD
160 16 0
1 4 2
 (161)10 = (241)8

Example-2.6.23:
Convert (177)10 into Octal

 177  8 = 22 remainder is 1
 22  8 = 2 remainder is 6
 2  8 = 0 remainder is 2
The answer is read from bottom to top as (261) 8, the same as with the binary case.

Dlogic102-num1 Numbers Systems and Codes


36
Another random document with
no related content on Scribd:
différence, pour le bruit, que du vol d’une hirondelle à celui d’un
aéroplane. Il balançait une espèce de pique, longue de plus de cinq
fois la longueur de son propre corps, et visait quelque chose, dans
un arbre. Son bras se détendit pour atteindre, à quarante mètres, un
magnifique perroquet, jaune et bleu, que je n’avais même pas su
voir. Mais ce n’était pas cette volaille qui m’intéressait, c’était la
pique, mince comme une canne à pêche : elle avait dix mètres de
haut ; et légère, et dure, inflexible ! Plus tard ce vieux m’expliqua qu’il
fallait abattre tout un gros arbre pour en tailler seulement deux. Il
coupait le tronc à la hache, et c’est encore avec cet outil civilisé qu’il
dégrossissait d’abord ses javelots : mais tout leur finissage était fait
avec des racloirs de pierre : un travail de six mois pour chacun
d’eux ! Au fond, des trucs comme ça, c’est peut-être plus difficile à
inventer et à fabriquer qu’un téléphone ; il y faut une espèce de
génie, et une adresse que nous n’avons pas. Ça m’amusait
tellement de le voir se servir de son bird’s spear — c’est le nom que
lui donnent les colons anglais — que je ne tirai plus un coup de
fusil : je le suivais comme un enfant pour le regarder. Ça le rendit
fier, et il devint ami avec moi, très vite. Il parlait assez bien pidgin, le
« sabir » international des mers du Sud, de sorte qu’on s’entendait
sans trop de peine. Il portait dans un sac en fibres de cocotier le
produit de sa chasse, près de deux douzaines d’aras de toutes les
couleurs, de beaux pigeons bleus, et deux porte-lyres. Je lui
demandai :
« — Tu les manges ? »
Il secoua la tête :
« — Manteau !… » fit-il brièvement.
Je sentis le cœur me sauter de joie. Ainsi, sans le vouloir, par un
pur hasard, j’étais tombé sur un bonhomme — le seul qui restât aux
Samoa, probablement, et dans toute l’Océanie — chez qui l’on
pratiquait encore cette industrie perdue. Je ne dis rien. J’ai vu assez
de sauvages dans ma vie pour savoir qu’il ne faut pas les brusquer.
Mais je le menai à mon petit campement, j’ouvris devant lui mon
bagage en regardant ses yeux pour voir quelles choses tenteraient
ses désirs. Il demeura d’une froideur suprême, jusqu’au moment où,
ne croyant plus que rien le pourrait séduire, je refermais, presque
aussitôt que je l’avais ouverte, une boîte d’hameçons anglais, tout à
fait ordinaires. Alors il fit : « Heu ! » du fond de la gorge, avec
admiration, car il fabriquait encore ses hameçons avec des arêtes de
poissons et les esquilles du squelette de petits oiseaux. Je lui donnai
tout de suite la boîte, bien entendu.
C’est ainsi que j’achevai sa conquête. Il me conduisit chez lui. Il
avait planté sa case dans un endroit délicieux, au bord d’une lagune
qui n’est séparée de la mer que par une étroite bande de coraux.
Des cocotiers qui poussent dans le sable, un sable fait de toutes
petites coquilles ; près de là, une petite rivière ombragée de
fougères arborescentes. C’était là qu’il vivait, avec sa vieille vahiné,
son fils aîné, un beau diable aux traits presque européens, et pas
plus brun de peau qu’un Italien, aussi grand et aussi fort que lui,
mais qui boitait très bas d’une jambe ; la vahiné de ce fils, encore
jeune et très jolie, ma foi, malgré les yeux un peu enfoncés de sa
race, qui donnent l’air de regarder en dessous, et les deux enfants
du ménage, tout nus, souples, câlins et malins comme de petits
chats. Je croyais que c’était tout, mais j’entendis geindre et tousser
dans la case ; et quand j’y pénétrai, bien qu’il n’y sentît pas bon, car
elle n’avait qu’une fenêtre et une porte, toutes deux très basses, à la
mode du pays, je vis se lever à demi, pour me faire honneur, son
second fils, roulé dans des tas de couvertures, et grelottant. Ce
n’était plus qu’un squelette ambulant : il me parut au dernier degré
de la phtisie.
… Et puis la grosse vahiné et sa bru, en train de tisser le
manteau de plumes ! On ne peut pas se figurer ça, même en rêve,
même en fumant l’opium ! Le vieux, qui s’appelait Taouhaki, me dit
qu’il serait fini dans quinze jours.
J’en avais une envie, une envie, de ce manteau ! Je savais qu’à
Londres ou à Paris je le revendrais bien mille livres. Alors je tirai mes
plans pour me le faire donner… Je vois que je vous choque, mais
vous n’y êtes pas ; dans les mers du Sud, on n’achète jamais rien :
vous faites un cadeau, on vous rend un cadeau. J’envoyai mon
matelot, avec la barque, à Apia, en lui disant de me rapporter le plus
beau gramophone qu’il pourrait trouver.
J’en eus pour mes vingt-cinq livres ; c’était un gramophone
boche, tout ce qui se fait de mieux. Et, en effet, quand ils entendirent
la Marseillaise, Rule Britannia, la Wacht am Rhein, la chanson de
Mignon, et Plus près de toi, mon Dieu, l’hymne qu’on jouait, vous
savez, quand le Titanic a sombré, ils furent éperdus d’enthousiasme.
Le tuberculeux lui-même sortit pour entendre ; il pleurait d’émotion et
de volupté. Ces pauvres gens ne pouvaient croire qu’il y eût au
monde chose plus merveilleuse.
Je finis par leur laisser mettre les disques qu’ils voulaient, et
pendant ce temps-là, m’appliquai à lire les journaux. Vous vous
souvenez qu’elles n’étaient pas gaies, les nouvelles de la guerre, au
printemps 1918. Ça m’absorbait, et je n’avais pas envie de rire.
Taouhaki s’en aperçut. Il me demanda, compatissant :
« — Ton cœur est sous la pluie ?
« — Ce sont des nouvelles de la guerre, en Europe, lui dis-je.
Sa réponse m’étonna. Il prit une figure toute riante :
« — Vous avez la guerre, en Europe ? Vous êtes bien heureux !
— Heureux ! fis-je sévèrement ; notre guerre a coûté des millions
et des millions de vies ! »
Parler de millions à des gens qui ne peuvent compter que jusqu’à
cinq, sur les doigts d’une seule main, c’était une bêtise. Il ne comprit
pas, et me crut encore moins.
« Vous êtes bien heureux ! reprit-il. Ah ! si nous pouvions encore
avoir la guerre, aux Samoa ! Je n’aurais pas un fils infirme pour le
reste de sa vie, et l’autre qui va mourir ! »
Je traduis son pidgin, vous concevez. Et voilà l’histoire
incroyable, l’histoire absurde qu’il me conta :
« — Il y a beaucoup de feuilles mortes depuis ce temps-là
(beaucoup d’années écoulées), on se faisait la guerre une fois par
lune, aux Samoa ! Tantôt avec une tribu, tantôt avec une autre, un
seul jour, une fois par lune, et c’était un jour de réjouissance…
« — Mais les morts, les blessés ? lui représentai-je.
« — Il n’y avait jamais de morts, jamais de blessés, protesta-t-il,
stupéfait. On essayait de se surprendre, il y avait des règles établies
depuis toujours, pour montrer celui qui est le plus fort… Alors le plus
faible se reconnaissait vaincu : ce n’est pas la peine de se laisser
tuer quand on est le plus faible… Une fois, dans ma jeunesse, il y a
eu un mort, pourtant, par accident. Ça causa une telle tristesse que
les deux armées rentrèrent tout de suite chez elles, et c’est la seule
fois où il n’y a eu ni vainqueur ni vaincu !
« Mais les missionnaires protestants d’Amérique et d’Angleterre
sont arrivés, ils nous ont convertis, et ils ont dit : « Comment, vous
faites la guerre ! C’est immoral, c’est épouvantable, c’est défendu
par Dieu ! Il ne faut plus faire la guerre ! »
« On jour a répondu : « Mais c’est la seule chose qui nous
amuse ! — Nous allons vous apprendre un jeu qui a la faveur de
Notre Seigneur Jésus-Christ, ont dit ces missionnaires, et qui est
bien plus amusant que la guerre. Ça s’appelle le kika (le cricket). »
« Ils nous ont appris le kika. Ça se joue avec des boules très
lourdes, entourées de peau, et des espèces de bottes encore plus
lourdes. A la première partie, notre roi est tombé, la tête fracassée
par une de ces boules, et il est mort encore trois Samoëns, parce
que nous y mettions beaucoup de vigueur. Alors les hommes de la
tribu qui avaient eu le plus de tués ont demandé leur revanche pour
le samedi suivant, et depuis ce moment-là, il meurt au cricket cinq
ou six Samoëns par semaine. C’est un fléau abominable ! Mon
second fils a eu la poitrine broyée par une boule, et c’est depuis ce
jour-là qu’il est malade. L’aîné a eu la jambe cassée… Je me suis
dit : « Ils vont le faire mourir aussi ! » Et c’est pour ça que je suis allé
m’établir avec ma famille à Toutouila, où on ne joue pas au kika. »
« — Voilà ! reprit le capitaine Birchwood ; j’appris ainsi qu’il est
toujours funeste de changer les usages d’un peuple, et ça me fit
plaisir de voir que les missionnaires avaient fait une sottise, parce
que nous, les marins et les commerçants, nous n’aimons pas les
missionnaires… Mais je pensais toujours au manteau ! Quand il fut
tout à fait fini, je dis à Taouhaki, en lui montrant le gramophone :
« — Tiens, je te le donne. »
Il secoua la tête :
« — Je ne puis l’accepter, dit-il, je ne puis rien te donner en
échange qui le vaille ! »
Je m’attendais bien à ça ; je suggérai :
« — Si, le manteau ! »
Il prit une figure désolée, et fit : « Non, non ! » de la tête. J’insistai.
Il s’obstina. Je devenais enragé ! Livre par livre, j’allai jusqu’à lui offrir
cinq cents guinées pour le manteau, en sus du gramophone. Il
secouait toujours la tête. « Cinq cents guinées ! fis-je. Tu pourras te
faire bâtir une belle maison, venue toute faite d’Amérique, avec un
toit en tôle ondulée ! » Je lui disais ça parce que c’est leur rêve, à
tous les Samoëns, d’avoir une maison américaine. Il répondait
toujours : « Non ! ».
— Mais enfin, pourquoi ne veux-tu pas ?
— Le manteau est pour mon fils qui va mourir, dit-il. Pour
l’ensevelir : afin qu’il soit chaudement et magnifiquement vêtu, sous
la terre ! »

« — Comprenez-vous ça ! Il refusait treize mille francs, plus ce


gramophone qu’il désirait tant ! Il aimait mieux que ce manteau, ce
chef-d’œuvre de manteau, allât pourrir avec un mort ! Ces sauvages
ne penseront jamais comme nous !
« — Ta vahiné en fera un autre, proposai-je par manière de
transaction. Et moi, qui vais partir, j’emporterai celui-là !
— Non ! répliqua-t-il encore, il faut deux ans pour faire un
manteau, et tu sais bien que mon fils sera mort avant la nouvelle
lune… »
Je ne sais pas pourquoi, mais quand je me rembarquai, je lui
laissai tout de même le gramophone. Peut-être parce que cet outil
m’embêtait. Peut-être parce que j’avais les larmes aux yeux… Lui-
même pleura comme un enfant :
« Mon fils mourra heureux, dit-il, en m’embrassant, et après sa
mort, son esprit viendra écouter et restera près de nous ! »
L’OMBRE DE BYRON

En 1912, me conta mon excellent ami le professeur John


Coxswain, dont les remarquables travaux sur les phénomènes
psychiques sont universellement connus, il n’était bruit que des
« communications » qu’un médium, Mrs. Margaret Allen,
d’Edimbourg, recevait de l’esprit désincarné du poète Byron. Celles-
ci présentaient un caractère d’authenticité particulièrement frappant,
et, il faut le dire, bien rare en pareil cas. Non seulement l’ombre de
Byron dictait des vers remarquables, non seulement elle s’exprimait
directement par la bouche même du médium, au lieu d’employer un
guéridon ou l’écriture automatique — et ceci avec une voix mâle,
décidée, bien différente du timbre de Mrs. Allen à l’état normal, et en
donnant à la langue anglaise la prononciation usitée au début du
XIXe siècle, dont le nôtre s’est déjà bien écarté — mais encore elle
avait indiqué l’endroit où l’on pourrait trouver des lettres, et jusqu’à
des poèmes encore inédits de l’illustre auteur de Childe Harold.
L’événement fut considéré comme assez important pour que la
Society for Psychical Researches, de Londres, me priât d’aller à
Edimbourg contrôler les séances et en dresser procès-verbal.
Mais la société n’a jamais publié mon compte rendu dans ses
Proceedings, par suite de la singulière, et je puis dire, sans être taxé
d’exagération, improper physionomie que présentèrent les
communications peu de temps après mon arrivée. Il est impossible
de taxer Mrs. Allen de supercherie. C’est une femme de mœurs
irréprochables, âgée d’environ trente-cinq ans, veuve, de réputation
intacte, et qui, dans ses conversations, n’a jamais marqué aucun
penchant à la légèreté. J’ajouterai qu’elle jouit d’une fortune assez
considérable, qu’elle prêtait gratuitement son concours aux
expériences, enfin que ses dons exceptionnels avaient été
découverts par Mr. Archibald Mac Braid, le propre ministre de la
chapelle presbytérienne qu’elle fréquentait régulièrement, faisant
preuve d’une piété vive et éclairée tout à la fois. Mr. Mac Braid
suivait assidûment les séances. Il avait été fort édifié par les
sentiments religieux que George Gordon, lord Byron, avait
manifestés. Ce grand poète déclarait regretter les erreurs de son
existence terrestre, et le scandale de ses amours, qu’il ne
mentionnait du reste qu’avec les plus respectables réserves,
cherchant à peine à donner pour excuse « que c’était surtout en
Italie qu’il avait fait ça ». Il ne cachait pas que ses fautes ne lui
avaient pas encore permis d’atteindre un rang élevé dans la
hiérarchie des esprits, et que, par exemple, cet imbécile de John
Ruskin y siégeait fort au-dessus de lui. L’expression peu correcte, et
véritablement bien injuste, dont il venait de se servir, à l’égard d’un
glorieux écrivain qui avait su garder la foi, lui ayant été reprochée, il
avait mis sa mauvaise humeur, avec une modestie fort touchante,
sur le compte d’une vanité littéraire dont il rougissait de ne se point
voir encore exempt.
A la première séance à laquelle je pus assister, je l’interrogeai
sur Shelley, son ami, dont il avait à Livourne, dans une cérémonie
sublime, sur le sable de la plage, brûlé le corps héroïque aux
flammes d’un bûcher de cèdre et de myrte. Il me répondit d’un ton
de regret que ce pauvre Shelley était toujours païen, et qu’il en était
bien triste. Mais, à la seconde séance, notre surprise et, je dois le
reconnaître, notre déception, ne furent pas médiocres d’entendre
une voix toute différente s’exprimer par l’organe du médium. Elle
était mâle, comme celle du précédent désincarné, mais amène,
retenue, délicatement onctueuse. Ce nouveau désincarné, d’ailleurs,
s’empressa de se présenter : Augustus Lewis Barnard, mort en 1847
et, de son vivant, ministre de la petite église presbytérienne qui, dès
cette époque, existait à Florence.
Mr. Mac Braid exprima poliment le plaisir qu’il éprouvait d’entrer
en relations avec un confrère de l’autre monde, mais ne chercha
point à dissimuler que ce n’était point lui qu’on attendait.
— Je sais, répondit Mr. Lewis Barnard, c’est Byron… Mais il ne
viendra pas aujourd’hui — ni probablement les jours suivants. En
fait, je ne suis ici que pour vous en avertir : il m’eût été réellement
pénible qu’un pasteur de l’église dont j’ai fait partie attendît en vain,
ainsi qu’une personne venue tout exprès de Londres.
Il ajouta quelques mots aimables à mon adresse. Je vous
demande la permission de ne les point répéter, d’autant plus qu’ils
sont sans importance pour la suite de ces proceedings. Mais
puisque je paraissais n’être pas inconnu du désincarné, je me
permis de lui demander à quelle cause il fallait attribuer l’absence —
j’avais envie de prononcer la désertion — de lord Byron.
— Il est enrhumé ! déclara le désincarné Lewis Barnard.
On distinguait un certain embarras dans cette brève réponse.
Vous pouvez juger que de plus elle nous parut incroyable. M. le
ministre Mac Braid observa qu’il n’avait pas encore entendu parler
d’un esprit enrhumé.
— Pourquoi pas ? répliqua son confrère, d’un ton découragé…
Tout est tellement comme ici, de l’autre côté : il y a eu, ces temps
derniers, une épidémie de grippe !… Mais un homme qui a exercé
sur la terre une profession sacrée ne doit pas mentir, même dans les
petites choses, et pour défendre une réputation, hélas ! bien
usurpée. J’aime mieux tout vous dire : ce pauvre Byron se dérange !
Encore une fois !
— Il se dérange ?…
— Oui…
Un grand soupir passa par la poitrine du médium, Mrs. Margaret
Allen. La voix de l’esprit continua par sa bouche :
— Il se dérange !… Et avec une danseuse française, encore, bien
qu’elle porte un nom allemand, Fanny Elssler : tout ce qu’il y a de
pis ! Il a même des histoires, à cause d’elle, avec un certain M. de
Montrond qui prétend avoir été le confident de M. de Talleyrand, être
mort aux îles du Cap-Vert, et se montre amoureux fou de cette
personne dangereuse… Mylord veut se battre en duel avec lui…
Tout cela est bien triste !
— Mais, fis-je avec vivacité, ce que vous nous racontez là est
absurde. Des désincarnés ne peuvent pas se battre en duel, voyons,
ni être amoureux ! c’est une supposition ridicule !
— Pourquoi pas ? fit Mr. Lewis Barnard, de son ton toujours
lassé. Je vous dis que chez nous tout est pareil. Et vous devez bien
le savoir, puisque vous recevez continuellement la visite d’esprits qui
nous disent qu’ils vont à la campagne, qu’ils écoutent des concerts,
que même on y abuse de la musique classique, et qu’à la belle
saison ils iront aux bains de mer : vous n’avez qu’à lire Raymond, ou
la vie et la mort, de sir Oliver Lodge… Seulement, voilà : ce
malheureux Byron est fou tout de même ! Il faut qu’il ait le vice
enraciné dans ce qui lui reste de corps…
— M. le ministre Lewis Barnard, nous vous comprenons de
moins en moins !
— C’est pourtant bien simple : notre sensibilité est très atténuée.
Et même, à mesure que se prolonge notre existence supra-terrestre,
elle diminue encore. Alors ce n’est plus très amusant… Tenez, moi
qui suis mort en 1847, il m’est déjà très facile de résister aux
tentations. Je trouve que c’est bien loin de ce que j’éprouvais sur
terre, c’est insignifiant, tout à fait insignifiant… Et pour Byron, qui est
mort en 1824… qu’est-ce qui peut bien lui rester, je vous le
demande ! Ce dévergondage dérisoire n’en est que plus honteux.
— Mais, observa Mr. Mac Braid, il nous avait dit qu’il regrettait sa
conduite, qu’il était tout à fait corrigé, qu’il prendrait exemple sur Mr.
John Ruskin…
— Mylord s’est f…tu de vous, répondit le ministre.
DU BERGER A LA BERGÈRE

M. Devoze, homme d’affaires remarquable et fort entreprenant,


n’a aux yeux de sa femme que deux graves défauts : la couleur de
ses cravates, qu’il s’obstine à choisir dans une nuance rouge qu’elle
estime du plus déplorable goût, et sa manie de consulter des
somnambules en ajoutant à leurs prédictions la foi la plus ardente et
la plus convaincue.
Pour la couleur de ses cravates, c’est chez M. Devoze un instinct
congénital et malheureux. Nul ne saura jamais pourquoi les Arabes
s’habillent en blanc et les Annamites en noir, sans que rien les en
puisse détourner. De même, il y a des hommes qui ne trouvent rien
de plus beau que le vert, le jaune, le bleu ou le rouge : ils sont nés
comme ça, il est inutile de tenter quoi que ce soit pour leur faire
préférer le vert au jaune, ou le bleu au rouge.
Pour sa foi dans les somnambules, elle vient sans doute à M.
Devoze de ce que justement c’est en affaires un homme
entreprenant, même téméraire. Accoutumé à risquer beaucoup, il
croit à la chance : on a remarqué que la plupart des joueurs sont
superstitieux, et Catherine de Médicis, Wallenstein, bien d’autres
grands politiques ou d’illustres généraux, eurent leur astrologue,
sans doute pour la même raison que M. Devoze a sa somnambule,
extralucide, comme il se doit. On se demande avec anxiété :
« Réussirai-je ? » Et comme on ne saurait s’en donner,
raisonnablement, des motifs certains, on invoque le concours des
personnes qui prétendent jouir du privilège de percer les voiles de
l’avenir.
Il n’en est pas de même de Mme Devoze. Elle a de l’intrépidité.
Bien que fort honnête, elle ne craint Dieu ni Diable. Son incrédulité
est dédaigneuse et totale, comme ses gestes ont d’ordinaire toute la
précision de l’impulsivité. Ajoutons un détail que nous ne pouvons
tenir que de M. Devoze lui-même — car c’est, il convient de le
répéter ici, encore une fois, une personne fort honnête :
— Tu me reproches la couleur de mes cravates, lui dit
fréquemment M. Devoze ; tu ferais bien mieux de porter des
pantalons. Toutes les femmes en portent et tu devrais faire comme
toutes les femmes. Une combinaison si tu veux, mais enfin quelque
chose. D’abord, cela serait plus décent : ensuite, je suis persuadé
que cela est plus sain. Tu prendras froid.
Mais Mme Devoze lève les épaules. Ni sa mère ni sa grand’mère
n’en ont porté ; c’est une femme de tradition : elle se passera de cet
accessoire de toilette aussi bien que ses aïeules, dont on n’a jamais
dit de mal, Dieu merci, encore qu’elles eussent le langage un peu
vert, comme il est de coutume en Bourgogne, le geste assez vif, et
qui ne sont mortes qu’à un âge avancé.
Après quoi l’on revient sur le chapitre de la somnambule. Celle
que fréquente M. Devoze, Mme Hertha, possède, à son dire, des
dons de seconde vue extraordinaires. Mme Devoze renouvelle
l’expression de son dédain.
— Je t’assure, lui dit son mari, que tu devrais aller la consulter :
tu serais stupéfaite. Bien plus : tu serais convertie.
Sa femme répond que se convertir aux somnambules, c’est se
convertir à l’imbécillité ; qu’il suffit d’un esprit faible dans le ménage ;
qu’elle ne se laissera pas plus convertir aux somnambules qu’à
manger de la soupe au potiron, qu’elle a en horreur. Dans un bon
ménage, un ménage qui s’entend bien, il faut toujours qu’il y ait
quelque discussion de cette sorte : cela entretient l’amitié.
Cela dure depuis dix ans. Au bout de dix ans, regardant encore
une fois les cravates de son mari, voici qu’un jour, par une sorte
d’illumination, Mme Devoze associe dans un éclair les deux sujets de
dissension que le ciel bienfaisant maintient entre elle et son époux.
Et, semblant tout à coup céder :
— Soit, dit-elle, puisque tu en dis tant de bien, de ta Mme Hertha,
j’irai la voir ! Et dès cet après-midi.
M. Devoze en est bien content et — les croyants, dans leur
ferveur, ont de ces petites faiblesses — s’empresse de téléphoner
discrètement à Mme Hertha pour lui annoncer la visite de sa femme,
afin que celle-ci demeure plus frappée encore de l’exactitude des
révélations qu’elle recevra sur son passé. Quant à l’avenir, il
comptait sincèrement sur la clairvoyance de la pythonisse.
A la manière dont elle est accueillie, Mme Devoze ne manque
point de s’apercevoir qu’elle était attendue : mais cela rentre dans
ses plans. Elle se montre, avec Mme Hertha, de la dernière
confiance, affecte pour tout ce que celle-ci peut annoncer ou
découvrir, un enthousiasme émerveillé, la traite au bout d’un quart
d’heure comme une amie, enfin se précipite aux suprêmes
confidences : « Il n’y a rien dans sa vie, rien. Elle aime uniquement
son mari, que Mme Hertha connaît peut-être, qui s’appelle M.
Devoze… La seule chose qui, dans sa personne, lui porte sur les
nerfs, ce sont ses cravates. »
Mme Hertha est bonne personne. Sans rien dire, elle se promet
d’arranger l’affaire. Et dès qu’elle revoit son habituel client, qui ne se
fait guère attendre, lui dit le plus sérieusement du monde :
— Je distingue pour vous le succès le plus satisfaisant…
Toutefois, abstenez-vous de porter sur vous quoi que ce soit de
rouge : cette couleur vous est hostile.
M. Devoze est crédule, mais il est sagace. Il obéit au conseil qu’il
vient de recevoir, de quoi sa femme s’applaudit malignement dans
son for intérieur ; mais pourtant, ne peut s’empêcher d’établir un
rapport entre la visite que sa femme vient de faire à la somnambule,
et la suggestion subite que vient de lui communiquer celle-ci, alors
que depuis si longtemps la nuance de ses cravates avait paru fort
indifférente aux puissances mystérieuses du destin. Le tour lui
semble simplement bien joué ; il a fort bon caractère, mais il se
promet d’avoir sa revanche.
A quelque temps de là, Mme Devoze prend mal à la gorge : une
assez insignifiante angine. Cependant son mari manifeste la plus
touchante inquiétude, obtient de sa femme qu’elle aille voir,
incontinent, l’excellent docteur Blinières, leur ami et le médecin du
ménage. Elle y consent. Alors, se frottant les mains, M. Devoze
téléphone encore, mais cette fois au docteur, non plus à la
pythonisse, pour lui donner quelques instructions.
Mme Devoze entre dans le cabinet du docteur Blinières quelques
heures plus tard, avec sa désinvolture usuelle ; elle est leste,
décidée, gaillarde et de hait. Professionnellement, avec un grand
sérieux, le docteur lui fait ouvrir la bouche, baisser la langue, en y
appuyant une spatule de nickel, et commandant à sa cliente de faire
« Ah ! Ah ! Ah ! » comme l’impose un immémorial usage.
— Je vois ce que c’est, fait-il. Une petite angine. Ce ne sera rien.
Seulement, chère madame, vous devez être fort sujette à cette sorte
de refroidissement. Je suis sûr, permettez-moi de le suggérer, que
vous n’êtes point, en dessous, vêtue assez chaudement. Je vous
recommande l’usage de la flanelle, et des pantalons.
Car tel a été le message dont il fut l’objet quelques instants
auparavant, de la part de M. Devoze. Il accomplit sa mission avec
fidélité.
Mais, de même que M. Devoze avait compris que sa femme
n’était point étrangère aux injonctions relatives à sa toilette qu’il avait
reçues de Mme Hertha, de même Mme Devoze soupçonne
directement la complicité, en cette matière, de son mari et du
médecin.
— Eh quoi ! docteur, dit-elle, d’un air admiratif, rien qu’en
regardant ma gorge vous avez pu deviner ce qui se passait plus bas,
beaucoup plus bas ? C’est étonnant, c’est merveilleux !
— L’habitude, l’expérience, madame, répond le docteur Blinières
qui a peur de rougir. La science a des yeux qui lui permettent de
percer bien des secrets, du moins de les pressentir…
… Alors, avec sa bravoure et son intrépidité ordinaires, debout
devant le docteur et troussant impétueusement ses dessous, qui
sont aimables, Mme Devoze lui dit joyeusement, d’une voix toute
naturelle :
— Eh ! bien, docteur, puisqu’en regardant ma gorge vous avez pu
voir ce qu’il y a ou ce qu’il n’y a pas ici, en regardant par là veuillez
me dire si mon chapeau est droit sur ma tête !…
LE PARFUM

C’était du côté de la Bastille ; je rentrais chez moi en suivant les


quais… L’homme qui croisa ma route me jeta un regard en passant.
Je ne le reconnus pas, mais je vis ses yeux, des yeux
surhumainement purs, jeunes, candides, des yeux comme des fleurs
toutes fraîches. Il disparut au tournant de la rue des Lions-Saint-
Paul, et c’est alors seulement que la mémoire me revint : « C’est
Sartis, me dis-je, en vérité, c’est Sartis ! » Je courus pour le
rattraper ; je courais après ce qu’on a toujours de plus cher : un
morceau de jeunesse.
Il y a vingt ans, j’avais pensé de Sartis, comme tous ceux qui le
connaissaient : « C’est un esprit au-dessus du mien ; au-dessus de
ma taille et de celle de tout le monde. » Il en est ainsi, parfois, — très
rarement, — des jeunes gens dont le génie apparaît tout formé, tout
armé, avec une précocité presque effrayante. Ils n’imitent personne,
à l’âge où leur génération ne fait encore qu’imiter, cherchant sa voie ;
ils transforment ce qu’ils touchent, les choses, les sciences, l’art
accumulé par les siècles ; et cet héritage, ensuite, l’humanité ne le
voit plus que par leurs œuvres. Mais il y a pour eux bien souvent,
une terrible rançon à payer : la tuberculose. Il semble que ce soit ce
fléau qui les mûrisse en les brûlant. Ils meurent sans avoir réalisé
leurs sublimes promesses ; ils ne laissent qu’un nom vide et brillant
dans la mémoire de quelques-uns.
Un jour, un ami m’avait dit : « Tiens ! Sartis ? Qu’est-ce qu’il est
devenu ? On ne le voit plus et on ne voit plus rien de lui ? » Je
répliquai : « C’est vrai, je n’y pensais pas… » La vie de Paris est
ainsi. Ceux qui l’avaient connu, et l’admiraient, attendirent quelque
temps. Peut-être faisait-il une « retraite » en province. On le savait
méditatif, assez altier ; rétractile. Puis, comme il ne reparut point, on
l’avait oublié ; non pas moi, mais je croyais qu’il avait été mourir,
dans quelque coin, en silence.
Voilà que c’était lui, toujours vivant ! Je le rejoignis.
— Sartis ! fis-je, plus ému que l’événement, sans doute, ne le
méritait, c’est toi ?
Il répliqua, d’une voix paisible et hautaine :
— Oui, c’est moi.
— Qu’est-ce que tu fais ?… demandai-je assez stupidement.
Il me semblait que, s’il s’était si longtemps plongé dans le silence
et séparé du monde, ce ne pouvait être que pour une œuvre
magnifique, immense, qui éclaterait tout à coup, qui éblouirait ; on a
foi dans les admirations de sa jeunesse.
Il me répondit, de la même voix, mais avec je ne sais quelle
nuance d’ardeur mystérieuse :
— Je vais chez moi !
Je vous jure que le plus fanatique des pèlerins de l’Islam,
marchant vers la Kaaba de la Mecque, n’eût prononcé ces mots,
d’apparence si banale, avec un plus fervent enthousiasme.
Subitement, comme je le considérais, je ne pus m’empêcher de
crier :
— Que tu as l’air jeune !
Ces vingt années avaient passé sur lui comme un seul jour. Il
était le même, le même ! Il était toujours le même jeune homme ! Et
moi…
— Oui, fit-il, faisant écho à ma pensée, tes cheveux ont blanchi.
C’est que nous n’avons pas eu la même vie : tu as vécu, tandis
que…
— Tandis que toi ?
— Oh ! fit-il en souriant, moi, ce n’est pas la même chose :
j’attends !
— Qu’est-ce que tu attends ?
Il hésita d’abord à s’expliquer. Puis, comme se parlant à lui-
même :
— Après tout, pourquoi ne pas lui dire, pourquoi ne pas dire ?…
Viens avec moi !
A travers les vieilles rues du vieux Marais, nous marchâmes
quelques moments en silence.
— C’est là ! fit bientôt Sartis.
Ces mots avaient sonné dans sa bouche avec un accent
singulier, où il y avait presque de l’extase — du respect, de la
vénération, en tout cas : l’accent d’un moine pieux qui vous montre
un sanctuaire, ou la châsse qui contient une relique sans prix. Il
s’était arrêté devant une antique demeure, au fond d’une cour : des
pilastres droits et un fronton avec un œil de bœuf ; un édifice noble
et grave qui datait de la première partie du règne de Louis XIV, et tel
qu’il s’en trouve encore quelques-uns dans ce quartier, envahi par le
commerce et les petites industries parisiennes, couvert à chaque
étage d’enseignes qui déshonorent les lignes de cette architecture,
mais, malgré tout, conservant je ne sais quelle grandeur. Imaginez
un gentilhomme réduit à demander l’aumône. Par un vaste escalier,
à l’évolution si douce que, jadis, les contemporains de Mme de
Sévigné l’avaient pu gravir en chaise à porteurs, il me fit monter au
troisième étage ; le second était occupé, à ce qu’il me sembla, par
les ateliers d’un maroquinier. Au troisième toutes les pièces,
primitivement, avaient dû se « commander » ; il fallait toutes les
traverser pour arriver à la dernière. Mais, à une époque déjà
ancienne, un des propriétaires avait ménagé, devant les fenêtres qui
donnaient sur la cour, une galerie qui desservait ces vastes
chambres ; et celles-ci, à leur tour, coupées en deux, trois parties par
des cloisons, formaient autant de modestes logements.
C’est dans un de ces logements que Sartis m’introduisit.
— Voilà vingt ans que je suis là, dit-il, vingt ans ! Et je mourrai ici
— le plus tard possible !
— Tu es heureux ?
Il me jeta un regard plein d’une joie ineffable.
— Oui, dit-il à voix basse : parce que j’ai toujours quelque chose
à désirer !
Il tira sa montre.
— Attends encore dix minutes, fit-il, d’une voix impatiente. Dans
dix minutes, je crois que tu comprendras… parce que d’autres ont
déjà fait l’expérience ! Je sais que je ne suis pas victime d’une
illusion : c’est tous les soirs, à la même heure. Parfois plus souvent ;
mais en tout cas tous les soirs, à cette heure-ci. Place-toi là dans ce
coin, avec moi…
Et voici ! C’est si peu de chose, en vérité ! Pourquoi n’en
porterais-je pas témoignage ? D’abord, cela ne peut-il s’expliquer par
des causes toutes naturelles : la transformation, peut-être, des
senteurs des maroquins du Levant emmagasinés à l’étage inférieur,
ou les exhalaisons des vieilles murailles de ces vieux édifices ? Ce
sont parfois d’horribles relents de décomposition. Mais pourquoi, une
fois par hasard, ne serait-ce point un parfum ? Car ce fut un parfum
qui, doucement, commença de flotter, très faible au début, puis plus
intense, et qui semblait se déplacer : un sillage de parfum, qui se
définissait, que je reconnaissais : l’odeur d’une gerbe d’œillets roses,
cette odeur un peu poivrée, voluptueuse…
— Suis-la ! chuchota Sartis. Elle va gagner la porte d’entrée et
sortir par la galerie. Toujours, toujours ! C’est toujours comme ça.
Et le mystère odorant, en effet, traversa les deux pièces, traversa
la galerie, sembla se perdre dans le grand escalier…
— Les autres locataires aussi le sentent, murmura Sartis. Je leur
ai demandé ; mais ils ne font pas attention. Ce sont de pauvres
gens ; ils ont autre chose à penser… Et n’entends-tu pas marcher
aussi ; deux petits talons de mules, sur le plancher ?
— Non, répondis-je, je n’entends rien.
— C’est parce qu’on fait du bruit dans les ateliers du dessous, fit
Sartis en soupirant, mais quelquefois j’entends, je t’assure : deux
petits talons de mules ; elle part, pour le souper et pour le jeu. Sa
chaise est toute prête en haut des marches. Elle a sa robe à grands
paniers, et un corps de jupe qui tombe très bas. Ses porteurs la
conduisent aux Tuileries. C’est avant que le Roi ait fait bâtir
Versailles.
— Tu l’as vue ?
— Non, avoua-t-il, secouant la tête, je ne l’ai pas vue, je sens
seulement l’odeur des œillets qui meurent à son corsage, et certains
jours, j’entends ses pas… Une autre fois, la nuit, très tard, j’ai perçu
un bruit de soie froissée, une femme qui se déshabillait ; et elle a ri !
Je te jure que j’ai entendu rire, dans cette nuit profonde. J’ai allumé
une bougie et il n’y avait rien. Mais j’attends ! Je te dis que j’attends !
Je sais comment elle est faite, et sa toilette, et sa beauté ! Et la
couleur de ses cheveux. Elle est blonde. Je crois aussi qu’elle porte
une pierre rose à l’annulaire de la main gauche.
— Et… demandai-je, tu sais qui elle est ?
Il réfléchit un instant, et répondit très sérieusement :
— Elle me le dira. Elle me le dira un jour ; quand elle se sera
complètement manifestée. Il faut du temps. Il faut… je ne sais pas ;
ça n’arrivera peut-être jamais. On ignore ce qu’il faut, à ces
créatures qui reviennent, pour qu’elles se manifestent
complètement : un état de grâce spécial, une espèce de permission
donnée par je ne sais qui. Je n’essaie même pas de lui parler, quand
elle est là ; elle pourrait s’en offusquer. C’est à elle de me parler la
première ; et puisque déjà, une fois, je te le répète, je l’ai entendue
rire !
— … Mais comme tu es jeune, Sartis, comme tu es resté jeune !
Je contemplais toujours ses cheveux bruns et ses traits sans
rides.
— Naturellement : puisque le temps s’est arrêté pour moi !
— Allons, adieu, Sartis !
— Adieu ! répondit-il avec indifférence.

You might also like