A letter to a ficticious client from me as a ficticious consult specifying the design of a device. This was written for a class assignment in ECE 473, Computer Organization and Architechture II.
Date: March 16, 1992
To: J. Primrose Lackluster, President
From: Scott Langley, Consultant Extraordinare
Creative Consultants, Inc.
Dear Mr. Primrose:
Our preliminary design of the portable Cardiac Monitor is complete. We hope that you find this design to your satisfaction. We have tried to make this document as clear and concise as is possible.
The useful data to be gathered for medical purposes are average heart rate, and maximum and minimum pressures over fifteen-minute intervals; and sufficient pressure samples in the vicinity of irregular heartbeats to allow careful analysis of them.
The first problem is to determine the heart rate from a sequence of blood pressure samples. We do this by taking samples at a known, fixed rate and counting the number of samples between local pressure maximums. This leads to the question of what should our sampling rate be? To answer this, we also must consider the sampling rate required to achieve an adequate resolution for irregular heart beats.
Consulting our library reference, we find where 100 samples / second is used by Sergio Chierchia and others in reference one, and 200 samples / second by J. Yasha Kresh and Stanley K. Brockman in reference two. Beings how the signal obtained in the first reference was quite adequate and the signal obtained in the second reference was termed robust, we feel that 100 samples / second should be adequate for our purposes.
Detection of irregular heartbeats is accomplished by comparing the period of the latest heartbeat with the average period of the last four heartbeats. If the latest heart beat differs in its period by 50% either way from the averaged period, we consider it irregular.
Calculation of the average heart rate over a fifteen-minute interval, is done by dividing the number of complete heart beats over the fifteen-minute interval by the accumulated sum of the heart beat periods. Thus, for accuracy's sake, partial heartbeats at the beginning and end of the fifteen-minute interval are not included for calculation purposes. The periods are measured in samples and the calulated average heartbeat is multiplied by 6000 to get heartbeats per minute.
Because the system operations do not change, and the relative simplicity of the operations to be performed, the decision was made to use a state machine design over a microprocessor design. Along with this, all measured values and intermediate results are stored in registers rather than in memory. This is due to the limited 8-byte word length of the memory available to us, and the faster speed of registers.
All arithmetic and logic operations, as well as register-to-register transfers are performed using the ALU. This saves considerable space from the alternative where all registers get unique logic and arithmetic function blocks for the tasks they are to perform. And routing space is saved by using the ALU for register-to-register transfers.
Arithmetic Logic Unit
The ALU has the functions of addition, subtraction, multiplication, division, and an implied compare using the sign-bit flag of the subtraction operation. This takes care of all operations and comparisons except the status of the counters when they reach their limits. They are handled by status flags to the controller. Because some of the processing required involves several steps, Register A and Register B are provided to store temporary results.
The controller consists of a state register, a reset register, and a status flag register connected to a ROM of size 256 X 64. The ROM provides control signals to the various devices and registers and the next state address for the state register. The controller is relatively fast and easy to implement for this system. The ROM conveniently handles the many control signals required in this device.
Status signals are necessary for the four counters, the data input strobe valid, the ALU subtraction sign-bit used for compare operations, and an interrupt line / system reset for allowing transfer of memory data.
Two 8K non-volatile memories are used for the system: one for the three values produced at 15-minute intervals; and one for the fifteen-seconds of blood pressure samples accompanying an irregular heartbeat. Memory #1 has a real-time clock as well. The clock is used to record the time of the system reset and the time of each irregular heartbeat occurrence.
At its store rate of 3 bytes every 15 minutes, Memory #1 has enough capacity for 28 days of monitoring. Memory #2, storing 1500 + 8 bytes for each irregular heartbeat can store five full 15 second instances. When either memory is full, the system halts and displays a LED indicator light indicating its Out of Memory condition.
Because blood pressure samples are stored continuously as they are read in (even for regular heartbeats), the data is written to memory windows. The data will be sequentially written to a circular memory window of 1500 bytes as long as no irregular heart beat is detected. Upon detection of an irregular heartbeat, the present memory address, contained in MAR21 and the memory window address, contained in MAWR, are written to the bottom end of the Memory #2, along with the current time. A 10 second counter (1000 samples) is enabled which counts down the samples to be stored after the irregular heartbeat. When the counter is finished, a new memory window is set, 1500 bytes directly after the previous one, and data is written again as before.
In the case where another irregular heartbeat is detected while the 1500 samples from a previous irregular heartbeat are still being written, a new memory window and block start address is written to the bottom of Memory #2, along with the time. Because no throw-away data was previously written in this memory window, it will be straight-line continuous and not circular on itself. A second 10 second counter is enabled and in this case, the two memory windows overlap. At the point where the first memory window overlaps on itself and no longer appends data to its highest absolute memory location, the data must be written again directly below the first memory window, to be included in the samples for the second memory window. Any more irregular heart beats during this phase can be handled identically to the second irregular heart beat. This is because their windows are all straight-line continuous. An additional counter is not needed; merely reset the second counter.
The data in from the transducer is loaded when the system is waiting for a data impulse and the data valid strobe is given. Wait states of various lengths are used, depending on the processing steps going on in the background, in order to maintain a near constant sampling rate of 100 samples per second.
In order to send data out to an external computer (the natural recourse when the memory is full), an external interrupt must be sent to the controller which halts the system and gives complete control of the memory to external data, address, and select lines. The external computer can then retrieve the data in the manner it chooses. After the external computer is finished and the external interrupt signal is removed, the system does a reset and zeros its memory pointers so it can right to its full 16K of memory again.
Our aims with this design were quick processing and easy implementation. If you balance the costs and benefits and find a different emphasis, we will gladly make the modifications you feel necessary. As always, we value you as our customer and wish to give you the best solution for your needs.
2. Kresh, J. Yasha and Stanley K. Brockman, "Arryhthmia Detection and Discrimination in Man by Monitoring Intramyocardial Pressure," pp.159-162, Computers in Cardiology, October 7-10, 1987, IEEE Computer Society.
This document represents my own unique work except for the scientific data obtained from
the two references above.