SlideShare a Scribd company logo
1 of 4
Download to read offline
Lecture 11: Registers
Registers are used widely in computer systems for a variety of purposes. Examples are the address register and
the program counter which you will meet (or have already met) in other parts of the course. The purpose of
this lecture is to introduce you to the different ways registers can be constructed to achieve the functionality
required in a computer.
We have already seen one example of a register, namely the bank of flipflops that store the state of a
synchronous circuit. A set of n flip flops can store any binary number in the range 0 to (2n − 1) or −(2n−1) to
+(2n−1 − 1), depending on whether we choose to represent the number as unsigned or signed. In the case of
the state register that we have used in our synchronous designs, we are concerned only with loading and storing
a binary number - the state - and so we need nothing more than a set of D-type flip flops with a common clock.
Frequently however, information in digital computers is in serial form. That means that, in contrast to the
state register where a number is read from a set of flip-flops at one instant of time, the bits of a number are a
function of time, and arrive one after the other on successive falling edges of a clock. The timing diagram, in
Figure 1, shows a serial bit stream representing a binary number with four bits.
In practice, most of the processing carried out inside a computer is done in parallel, to increase the speed,
whereas most of the transfer of information between computers is carried out in serial to reduce the cost of the
cables. (A serial signal can be carried on a cable containing a pair of wires, which is clearly going to be cheaper
than a cable containing nine wires for transmitting an eight bit number). So one important task is to convert
serial information into parallel form, and this is done using a shift register. Shift registers can be constructed
simply by joining up a set of D-type flip flops as shown in Figure 2. On each successive clock falling edge, the
data bit (Q) on a flip flop is loaded onto the flip flop on its right. Thus successive serial bits arriving at the input
travel through the register in four clock pulses.
Figure 1: Serial Data
Figure 2: Serial to Parallel Conversion
It is clear that parallel to serial conversion can be achieved in an analogous manner, provided that we can
load the parallel data into the register. To do this we need to add some further control circuitry which determines
the function of the register. In the simplest case we need to allow each flip flop to select its input either from
the previous stage (for serial/parallel conversion) or from an input bit for parallel load. The circuit that achieves
this selection is the multiplexer, which we have alredy met earlier in the course, and is shown in Figure 3. We
can add this to our previous register circuit to create a general purpose serial to parallel and parallel to serial
converter as shown in Figure 4.
Figure 3: Two Input Multiplexer
Clearly repetitive structures of this type can be of any length, and it should be noted that the time taken to
load serial data will increase with length. Serial communication cannot be done as fast as operations within
the processor. In fact, the inclusion of a serial load facility complicates our previous synchronous design
DOC112: Computer Hardware Lecture 11 1
Figure 4: A two function register
methodology, and therefore it is usual to use a separate clock from the system clock to convert between serial
and parallel systems, and to use other control lines to indicate when a conversion is complete and the register
can be read. The normal labelling convention for registers is that the most significant bit has the highest index
(PO3 above). They are usually drawn with the most significant bit on the left so that they conform to the same
conventions used to write a binary number. In Figure 4 the bits arrive least significant first, though this is not a
universal convention.
Serial to parallel conversion is not the only use of shift registers. It is well known that shifting a register
by one place to the left, and filling the bottom bit with zero, is equivalent to multiplying the number by two
(providing the register is long enough to represent the result), and conversely, shifting right is equivalent to
dividing by two. We could incorporate both serial to parallel conversion and multiplying and dividing by 2 in a
general purpose shift register. As an example we will design one with four modes defined as follows:
00 Hold
01 Shift Right
10 Shift Left
11 Parallel Load
The different modes can be selected using multiplexers. In this case we need a four way multiplexer. We can
build any multiplexer in two parts. The first it a binary to unary convertor, also known as a decoder. A 2-4
decoder is shown in Figure 5. The two input lines represent a two bit binary mumber, and the four output lines
are its unary representation. It will be clear that it is only possible for one of the four output lines to be 1 at any
one time. Using this as a component in its own right, we can design the four way multiplexer shown in Figure
6 simply by using the decoder outputs to control a gating circuit. This is really a four position switch, with the
position selected by the binary input on lines S0 and S!. The four input multiplexer can be incorporated into
Figure 5: Two bit Binary to Unary Converter
Figure 6: Four Input Multiplexer
the general purpose shift register of Figure 7. Here just one stage is shown, which is for bit i. A register of any
DOC112: Computer Hardware Lecture 11 2
length can be created by using one stage for each bit, connected as indicated in the figure. Each stage has one
multiplexer (MPX) connected to a D-Q flip flop. The parallel input is labelled PIi, and the papallel output POi.
Each multiplexer has the same control inputs (S1S0) so all multiplexers select the same input. Similarly all the
D-Q flip flops have the same clock, and change synchronously.
Figure 7: Four Function Register
Clocks and Registers
We have previously met registers in another form, namely counters, and we have seen that it is possible to
design them to operate in synchronisation with the system clock. It is sometimes useful to build counters for
the specific purpose of dividing clocks. We noted earlier in this lecture that loading a register serially may need
to be done at a rate that is slower than the processor clock. This is becaue serial transmission is limited by
the high capacitance in the long cables that need to be used. However, we would like the serial shift register
to work in synchronisation with the system clock, even if it is at a slower rate. it is possible to divide a clock
by two simply using the one bit counter shown in Figure 8. Here the value of D is taken directly from Q’,
and therefore at each clock pulse the flip flop will simply change state. If we look at the timing diagrams, we
see that Q will output a square wave which will be exactly half the frequency of the clock. We can therefore
consider the circuit a clock divider. For division by any other integer we can use a synchronous counter. If we
wish to divide a clock by say seven, we can do so by the circuit corresponding to the Moore machine of Figure
reffig:DivideBySeven. Remember that we just need to divide the number of falling edges in any time period by
seven. it doesn’t matter if the clock period is unevenly divided between 0 and 1.
Figure 8: Synchronous divide by two counter
Figure 9: Synchronous divide by seven
One obvious application of clock dividers is in wrist watches or quartz clocks. Here, the regulator is a
quartz crystal which has a characteristic property that allows a very accurate square wave of around 1MHz to
be produced. However, the stepper motor which drives the second hand needs one pulse every second, and
hence we need to interpose a circuit which divides the clock by 106. This can be done with a synchronous
counter with 20 stages, but, such a counter would have a lot of complex state sequencing logic. An alternative
DOC112: Computer Hardware Lecture 11 3
is to use a set of successive dividers. For example, we could design a circuit to divide by 256 by concatenating
two synchronous divide by sixteen circuits. In this configuration the clock input to the second stage is the output
of the first stage as shown in Figure 10. Designing a zero to sixteen counter is comparitively straight forward,
Figure 10: Asynchronous divide by 256 circuit
and hence, this strategy represents a viable way to achieve dividing by large numbers. However it is no longer
a synchronous counter since the second divide by 16 block changes after the first. Taking the above idea to
its simplest form, we could make our basic elements the divide by two circuit of Figure 8, and this creates a
famous circuit called the ripple through counter, which is shown in Figure 11. If a counter is to be limited to a
particular maximum value, then the ’clear’ input normally provided on a D-Q flip flop can be used. Thus, if we
wish to count to 5, then we would require three stages, and the ’clear’ input to each stage would be determined
by the minterm Q2 · Q1 · Q0, which in effect resets the counter to zero when it sees that the output is 5. This
principle can be extended easily to divide by any integer. It is very important to note that the ripple through
counter violates our principle of keeping the digital design synchronous. The correct state will only be present
on the outputs at a short time after the counting clock pulse, which will vary depending on how far the change
propagates. It is therefore very important to realise that this counter should be used only with extreme care, and
only when there is no time critical functionality in the circuit.
Figure 11: The ripple through counter
Figure 12: Count to five circuit
DOC112: Computer Hardware Lecture 11 4

More Related Content

What's hot

15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5RLJIT
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2RLJIT
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3RLJIT
 
Register transfer language
Register  transfer languageRegister  transfer language
Register transfer languagehamza munir
 
ECE_465_Sidharth_proj2_f13
ECE_465_Sidharth_proj2_f13ECE_465_Sidharth_proj2_f13
ECE_465_Sidharth_proj2_f13Sidharth Kumar
 
Register transfer and microoperations part 1
Register transfer and microoperations part 1Register transfer and microoperations part 1
Register transfer and microoperations part 1Prasenjit Dey
 
Lec 09 - Registers and Counters
Lec 09 - Registers and CountersLec 09 - Registers and Counters
Lec 09 - Registers and CountersVajira Thambawita
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modessb108ec
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operationsLakshya Sharma
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.pptISMT College
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04thearticlenow
 

What's hot (20)

15CS44 MP & MC module 5
15CS44 MP & MC  module 515CS44 MP & MC  module 5
15CS44 MP & MC module 5
 
Q010228189
Q010228189Q010228189
Q010228189
 
15CS44 MP & MC Module 2
15CS44 MP & MC Module  215CS44 MP & MC Module  2
15CS44 MP & MC Module 2
 
15CS44 MP &MC Module 3
15CS44 MP &MC Module 315CS44 MP &MC Module 3
15CS44 MP &MC Module 3
 
G31048051
G31048051G31048051
G31048051
 
J0166875
J0166875J0166875
J0166875
 
OSPF - Routing Protocol
OSPF - Routing ProtocolOSPF - Routing Protocol
OSPF - Routing Protocol
 
Sidharth_report_proj1
Sidharth_report_proj1Sidharth_report_proj1
Sidharth_report_proj1
 
Register transfer language
Register  transfer languageRegister  transfer language
Register transfer language
 
RTL
RTLRTL
RTL
 
ECE_465_Sidharth_proj2_f13
ECE_465_Sidharth_proj2_f13ECE_465_Sidharth_proj2_f13
ECE_465_Sidharth_proj2_f13
 
Register transfer and microoperations part 1
Register transfer and microoperations part 1Register transfer and microoperations part 1
Register transfer and microoperations part 1
 
Instruction.pdf
Instruction.pdfInstruction.pdf
Instruction.pdf
 
Lec 09 - Registers and Counters
Lec 09 - Registers and CountersLec 09 - Registers and Counters
Lec 09 - Registers and Counters
 
8051 addressing modes
8051 addressing modes8051 addressing modes
8051 addressing modes
 
Register transfer language & its micro operations
Register transfer language & its micro operationsRegister transfer language & its micro operations
Register transfer language & its micro operations
 
ARM inst set part 2
ARM inst set part 2ARM inst set part 2
ARM inst set part 2
 
Time delays & counter.ppt
Time delays & counter.pptTime delays & counter.ppt
Time delays & counter.ppt
 
CO by Rakesh Roshan
CO by Rakesh RoshanCO by Rakesh Roshan
CO by Rakesh Roshan
 
Register transfer & microoperations moris mano ch 04
Register transfer & microoperations    moris mano ch 04Register transfer & microoperations    moris mano ch 04
Register transfer & microoperations moris mano ch 04
 

Similar to Hardware lecture11

Bt0064 logic design2
Bt0064 logic design2Bt0064 logic design2
Bt0064 logic design2Techglyphs
 
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdfFREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdfssuser72979d
 
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING  ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING csijjournal
 
Analog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose MonitoringAnalog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose Monitoringcsijjournal
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processorBảo Hoang
 
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGAIRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGAIRJET Journal
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices Sachin Mehta
 
Structures for discrete time systems
Structures for discrete time systemsStructures for discrete time systems
Structures for discrete time systemsveda C
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015Edhole.com
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015Edhole.com
 
Bt0068 computer organization and architecture
Bt0068 computer organization and architecture Bt0068 computer organization and architecture
Bt0068 computer organization and architecture Techglyphs
 
Dynometer project data acquisition filtering
Dynometer project data acquisition filteringDynometer project data acquisition filtering
Dynometer project data acquisition filteringRa'uf Tailony
 
Digital Logic Counter.ppt
Digital Logic Counter.pptDigital Logic Counter.ppt
Digital Logic Counter.pptRaziyaSultana30
 

Similar to Hardware lecture11 (20)

Bt0064 logic design2
Bt0064 logic design2Bt0064 logic design2
Bt0064 logic design2
 
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdfFREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
FREQUENCY COUNTERS AND TIME-INTERVAL MEASUREMENTS.pdf
 
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING  ANALOG TO DIGITALCONVERTOR FOR  BLOOD-GLUCOSE MONITORING
ANALOG TO DIGITALCONVERTOR FOR BLOOD-GLUCOSE MONITORING
 
Analog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose MonitoringAnalog to Digitalconvertor for Blood-Glucose Monitoring
Analog to Digitalconvertor for Blood-Glucose Monitoring
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
 
Ijecet 06 08_001
Ijecet 06 08_001Ijecet 06 08_001
Ijecet 06 08_001
 
Ijecet 06 08_001
Ijecet 06 08_001Ijecet 06 08_001
Ijecet 06 08_001
 
Peripheral 8245,16550&8237 dma controller
Peripheral 8245,16550&8237 dma controllerPeripheral 8245,16550&8237 dma controller
Peripheral 8245,16550&8237 dma controller
 
Digital Control Systems
Digital  Control   Systems Digital  Control   Systems
Digital Control Systems
 
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGAIRJET-  	  To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
IRJET- To Design 16 bit Synchronous Microprocessor using VHDL on FPGA
 
FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices FPGA Implementation with Digital Devices
FPGA Implementation with Digital Devices
 
Structures for discrete time systems
Structures for discrete time systemsStructures for discrete time systems
Structures for discrete time systems
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015
 
Dcsd final report
Dcsd final reportDcsd final report
Dcsd final report
 
CO Module 5
CO Module 5CO Module 5
CO Module 5
 
Admission in india 2015
Admission in india 2015Admission in india 2015
Admission in india 2015
 
Chapter5 dek3133
Chapter5 dek3133Chapter5 dek3133
Chapter5 dek3133
 
Bt0068 computer organization and architecture
Bt0068 computer organization and architecture Bt0068 computer organization and architecture
Bt0068 computer organization and architecture
 
Dynometer project data acquisition filtering
Dynometer project data acquisition filteringDynometer project data acquisition filtering
Dynometer project data acquisition filtering
 
Digital Logic Counter.ppt
Digital Logic Counter.pptDigital Logic Counter.ppt
Digital Logic Counter.ppt
 

Recently uploaded

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 

Recently uploaded (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 

Hardware lecture11

  • 1. Lecture 11: Registers Registers are used widely in computer systems for a variety of purposes. Examples are the address register and the program counter which you will meet (or have already met) in other parts of the course. The purpose of this lecture is to introduce you to the different ways registers can be constructed to achieve the functionality required in a computer. We have already seen one example of a register, namely the bank of flipflops that store the state of a synchronous circuit. A set of n flip flops can store any binary number in the range 0 to (2n − 1) or −(2n−1) to +(2n−1 − 1), depending on whether we choose to represent the number as unsigned or signed. In the case of the state register that we have used in our synchronous designs, we are concerned only with loading and storing a binary number - the state - and so we need nothing more than a set of D-type flip flops with a common clock. Frequently however, information in digital computers is in serial form. That means that, in contrast to the state register where a number is read from a set of flip-flops at one instant of time, the bits of a number are a function of time, and arrive one after the other on successive falling edges of a clock. The timing diagram, in Figure 1, shows a serial bit stream representing a binary number with four bits. In practice, most of the processing carried out inside a computer is done in parallel, to increase the speed, whereas most of the transfer of information between computers is carried out in serial to reduce the cost of the cables. (A serial signal can be carried on a cable containing a pair of wires, which is clearly going to be cheaper than a cable containing nine wires for transmitting an eight bit number). So one important task is to convert serial information into parallel form, and this is done using a shift register. Shift registers can be constructed simply by joining up a set of D-type flip flops as shown in Figure 2. On each successive clock falling edge, the data bit (Q) on a flip flop is loaded onto the flip flop on its right. Thus successive serial bits arriving at the input travel through the register in four clock pulses. Figure 1: Serial Data Figure 2: Serial to Parallel Conversion It is clear that parallel to serial conversion can be achieved in an analogous manner, provided that we can load the parallel data into the register. To do this we need to add some further control circuitry which determines the function of the register. In the simplest case we need to allow each flip flop to select its input either from the previous stage (for serial/parallel conversion) or from an input bit for parallel load. The circuit that achieves this selection is the multiplexer, which we have alredy met earlier in the course, and is shown in Figure 3. We can add this to our previous register circuit to create a general purpose serial to parallel and parallel to serial converter as shown in Figure 4. Figure 3: Two Input Multiplexer Clearly repetitive structures of this type can be of any length, and it should be noted that the time taken to load serial data will increase with length. Serial communication cannot be done as fast as operations within the processor. In fact, the inclusion of a serial load facility complicates our previous synchronous design DOC112: Computer Hardware Lecture 11 1
  • 2. Figure 4: A two function register methodology, and therefore it is usual to use a separate clock from the system clock to convert between serial and parallel systems, and to use other control lines to indicate when a conversion is complete and the register can be read. The normal labelling convention for registers is that the most significant bit has the highest index (PO3 above). They are usually drawn with the most significant bit on the left so that they conform to the same conventions used to write a binary number. In Figure 4 the bits arrive least significant first, though this is not a universal convention. Serial to parallel conversion is not the only use of shift registers. It is well known that shifting a register by one place to the left, and filling the bottom bit with zero, is equivalent to multiplying the number by two (providing the register is long enough to represent the result), and conversely, shifting right is equivalent to dividing by two. We could incorporate both serial to parallel conversion and multiplying and dividing by 2 in a general purpose shift register. As an example we will design one with four modes defined as follows: 00 Hold 01 Shift Right 10 Shift Left 11 Parallel Load The different modes can be selected using multiplexers. In this case we need a four way multiplexer. We can build any multiplexer in two parts. The first it a binary to unary convertor, also known as a decoder. A 2-4 decoder is shown in Figure 5. The two input lines represent a two bit binary mumber, and the four output lines are its unary representation. It will be clear that it is only possible for one of the four output lines to be 1 at any one time. Using this as a component in its own right, we can design the four way multiplexer shown in Figure 6 simply by using the decoder outputs to control a gating circuit. This is really a four position switch, with the position selected by the binary input on lines S0 and S!. The four input multiplexer can be incorporated into Figure 5: Two bit Binary to Unary Converter Figure 6: Four Input Multiplexer the general purpose shift register of Figure 7. Here just one stage is shown, which is for bit i. A register of any DOC112: Computer Hardware Lecture 11 2
  • 3. length can be created by using one stage for each bit, connected as indicated in the figure. Each stage has one multiplexer (MPX) connected to a D-Q flip flop. The parallel input is labelled PIi, and the papallel output POi. Each multiplexer has the same control inputs (S1S0) so all multiplexers select the same input. Similarly all the D-Q flip flops have the same clock, and change synchronously. Figure 7: Four Function Register Clocks and Registers We have previously met registers in another form, namely counters, and we have seen that it is possible to design them to operate in synchronisation with the system clock. It is sometimes useful to build counters for the specific purpose of dividing clocks. We noted earlier in this lecture that loading a register serially may need to be done at a rate that is slower than the processor clock. This is becaue serial transmission is limited by the high capacitance in the long cables that need to be used. However, we would like the serial shift register to work in synchronisation with the system clock, even if it is at a slower rate. it is possible to divide a clock by two simply using the one bit counter shown in Figure 8. Here the value of D is taken directly from Q’, and therefore at each clock pulse the flip flop will simply change state. If we look at the timing diagrams, we see that Q will output a square wave which will be exactly half the frequency of the clock. We can therefore consider the circuit a clock divider. For division by any other integer we can use a synchronous counter. If we wish to divide a clock by say seven, we can do so by the circuit corresponding to the Moore machine of Figure reffig:DivideBySeven. Remember that we just need to divide the number of falling edges in any time period by seven. it doesn’t matter if the clock period is unevenly divided between 0 and 1. Figure 8: Synchronous divide by two counter Figure 9: Synchronous divide by seven One obvious application of clock dividers is in wrist watches or quartz clocks. Here, the regulator is a quartz crystal which has a characteristic property that allows a very accurate square wave of around 1MHz to be produced. However, the stepper motor which drives the second hand needs one pulse every second, and hence we need to interpose a circuit which divides the clock by 106. This can be done with a synchronous counter with 20 stages, but, such a counter would have a lot of complex state sequencing logic. An alternative DOC112: Computer Hardware Lecture 11 3
  • 4. is to use a set of successive dividers. For example, we could design a circuit to divide by 256 by concatenating two synchronous divide by sixteen circuits. In this configuration the clock input to the second stage is the output of the first stage as shown in Figure 10. Designing a zero to sixteen counter is comparitively straight forward, Figure 10: Asynchronous divide by 256 circuit and hence, this strategy represents a viable way to achieve dividing by large numbers. However it is no longer a synchronous counter since the second divide by 16 block changes after the first. Taking the above idea to its simplest form, we could make our basic elements the divide by two circuit of Figure 8, and this creates a famous circuit called the ripple through counter, which is shown in Figure 11. If a counter is to be limited to a particular maximum value, then the ’clear’ input normally provided on a D-Q flip flop can be used. Thus, if we wish to count to 5, then we would require three stages, and the ’clear’ input to each stage would be determined by the minterm Q2 · Q1 · Q0, which in effect resets the counter to zero when it sees that the output is 5. This principle can be extended easily to divide by any integer. It is very important to note that the ripple through counter violates our principle of keeping the digital design synchronous. The correct state will only be present on the outputs at a short time after the counting clock pulse, which will vary depending on how far the change propagates. It is therefore very important to realise that this counter should be used only with extreme care, and only when there is no time critical functionality in the circuit. Figure 11: The ripple through counter Figure 12: Count to five circuit DOC112: Computer Hardware Lecture 11 4