# Level Shifting Between TTL and CMOS

81,739

28

8

## Introduction: Level Shifting Between TTL and CMOS

There are two lines, called logic families,of analog IC's and while they can generally be interoperable "off the shelf," they work best with ICs of the same family and sometimes IC's of mixed logic families can require a voltage translation to get working correctly.  Often, though, our designs will have need to intermix different logic families.  This isn't always a problem when there is no inherent dependency on signaling between the logic IC's, and in some cases even signaling between them won't pose a problem.  However, in some cases, like when signaling between a CMOS IC and a TTL IC, there can be a problem because each logic family defines the valid range of voltage that make up a valid HIGH and valid LOW and the logic families don't agree on the range.

This instructable will briefly explain the two logic families of IC's you will most likely be encountering and using in your circuit designs and how to ensure that the HIGH or LOW output of the other is translated and interpreted correctly between a TTL and CMOS device.  This process is called voltage level shifting and is the subject of this instructable.

Turn the page and read up on the two logic families that you have probably already implemented in your designs.

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: TTL Integrated Circuits

TTL IC's -- members of the Bipolar Logic Family --  were first developed in the 1960's and are made with transistors, hence the name Transistor-Transistor Level (TTL) device.  The original line were 74xx series and have since been replaced with better performing TTL devices, such as the 74LSxx, 74ALSxx, and 74Fxx series.  The LS is a Low-power Schottky, ALS is an Advanced LS and F is Fast

The bipolar logic family, as the TTL series falls under have had consideral improvements, the first being the 74H which provided twice the speed of the original 74xx series, but at a cost of over twice the power consumption.  The next improvement was the74L which increased all the internal resistances, leading to a net improvement in power consumption, but increased the propagation delay.

A key improvement came with the 74S series which placed Schottky diodes across the base-to-collector junctions of the transistors.  Capacitive effects were reduced and yielded a speed increase of a factor of 5 with about a two-times increase in power consumption.  The above mentioned lines 74LSxx were derived from this series and reduced power consumption by about 1/3.  The 74ALSxx improved performance even further.  The 74F series, based on a new technology, reduced the propagation delays and even further reduced the size of the IC.

## Step 2: CMOS Integrated Circuits

There was an alternative to TTL IC's being developed at around the same time and these type of IC's were called CMOS (Complementary MOSFET) because of the inclusion and use of a high-impedance MOSFET. The high-impedance of the MOS circuit reduced the power dissipation of the circuit by a significant amount.  These CMOS series were called the 4000 series and had names like 4019 and 4027, etc.

The CMOS line also had a much wider operating voltage range (3V to 18V) and had a specific requirement for the voltage meaning HIGH and LOW, for both input and output to other integrated or digital circuits (which I will cover later).  The 4000 series, while offering greater power requirement reduction, were considerably slower than its TTL counterparts and were particularly susceptible to static discharges and were easily damaged by static electricity.

Several advances were made in the CMOS line.  The 74Cxx series were made to be pin-for-pin compatible with the TTL IC of the same name (ie 74138 == 74C138).  Also, later was introduced the 74HC and 74HCTxx series of CMOS IC's.  This High-speed CMOS (HC) line was also pin-compatible with the TTL series but still used the same voltage supply and logical voltage setup as the previous CMOS circuits.  The 74HCTxx series were High-Speed CMOS but were voltage-compatible with their TTL counterparts.  Finally, the "Advanced CMOS" 74ACxx series was developed to have a processing speed comparable to the 74F TTL line.

Today, which one you choose is mainly a decision based on availability, cost, and voltage requirements of your design.  However, there are still compatibility issues if you "mix and match" CMOS and TTL ICs because each logic family defined what a HIGH voltage was and what a LOW voltage was, and they are not generally compatible except in a small overlap.  What does this mean for us?  We may get lucky and it means nothing, but for most of us, it means that we have to design in some way to match each of the logic families logic voltage requirements in a process called voltage level shifting, or just level shifting.

## Step 3: The Problem Defined: Level-shifting

Each logic family defines the appropriate threshholds of what it will consider a HIGH or a LOW.  This choice being somewhat arbitrary, they did get it close.  Generally, a LOW is a signal with an amplitude of zero to one volt.  A HIGH varies the most and is the cause of our current level shifting consternation.

The TTL family allows a 2V - 5V difference to be counted as a HIGH and defines the threshold for output for HIGH as 2.7V to 5V.  In the CMOS family, an input wanting to define HIGH must bring between 3.5V and 5V.  But TTL only has to bring 2.7V, leaving a difference of almost a volt that is valid for TTL and invalid for CMOS.  It's when a TTL chip wants to send a HIGH and sources somewhere in that nebulous range that's not valid for CMOS HIGH but is for TTL.

The answer is to level shift.  This is the act of actively either shifting down or up a signal voltage to match a target IC. The most useful I've found is the shift up to 5V from 3.3V signal.

## Step 4: Using a Zener Diode

For unidirectional shifting from 5V to 3.3V, you don't get a much easier and straightforward (as well as cheap) solution as using a zener diode.  Find a zener diode that matches your voltage requirements, two common ones are 1N4733A (5.1V) and 1N5226 (3.3V).  You'll want to match your wattage; these are 0.5W diodes.

By attaching a load resistor inline before the zener diode, and taking the zener to ground, you can ensure that the voltage that gets past the zener is at or slightly below the zener voltage (Vz) of the zener diode.  In the example picture below, you can see that inputting a 5V signal outputs a 3.18V signal.

In the second example, I'm "regulating" 5.1V after stepping down from 10V.  This isn't to be confused with a constant-current/voltage regulation.  This is best used as a signal with little to no load.

## Step 5: Stepping Up Voltage With ATransistor

When you have a 3V HIGH input and need to step it up to a 5V HIGH input, nothing beats the cost, ease, and simplicity of using a transistor.  I've included two different circuits using the transistor for your perusal.  Both will step up a 3.3V to about 5V.  You may want to play around with the resistor values to get the transistor you're using to full saturation.

Notice the voltage divider network in the 2nd example.  I've found 10k ohm resistors yield the best value closest to 5V without going over.  Your mileage may vary.

## Step 6: Level-Shifting: Inverter Circuit

The idea here is to use an IC that is powered at the target voltage as the source for the signal amplitude step up.   In this case, I've used a 4069 Hex Inverter IC.  You could also use a 74HC04 or one of your choosing.  I use two of the inverters (there are six in this IC) to take the signal and step up the output to the Vcc of the IC.  There is no magic in choosing two inverters: they invert, so I wanted my HIGH input to maintain a HIGH output instead of being inverted.

The same idea can be applied to octal and hex line buffers without having to invert and this is useful if you have multiple signal elements that are coming out of an MCU or other logic family IC and are all having the same action applied (ie all being stepped up or stepped down).

## Step 7: Level-Shifting: Octal Bus Transceiver

The idea here is the same as for the inverter, except we're not inverting our signal.  We use the chip voltage as the Vcc for the output, so you can power it with 3.3V or 5V depending on which chip you use, and the output pin will source at that voltage.  In other words, 3.3V IN = 5V OUT and vice verse.

Some IC options here are 74*241, 74*244, 74*245.  You could also use a 4050 hex non-inverting buffer or any other one of your choosing.  In my example, I use the 4050.

## Step 8: Dedicated IC: CD4504 Level Translator

This IC is a CMOS hex voltage-level shifter for TTL-to-CMOS and CMOS-to-CMOS.  From the datasheet:

CD4504B hex voltage level-shifter consists of six circuits which shift the input signals from the Vcc logic level to the Vdd logic level.  To shift TTL signals to CMOS logic levels, the SELECT input is at the Vcc HIGH logic state.  When the SELECT input is at a LOW logic state, each circuit translates signals from one CMOS level to another.

Check the picture below or check out the datasheet for the pinout.  Essentially, your signal-to-be-shifted may be on AIN and it will be shifted and put back on AOUT.  Same for BIN and BOUT, etc.

## Step 9: Dedicated IC: MAXIM MAX3390

Power VL with your lower power IC and VCC with your higher power VCC.

• IVL1 to OVL1
• IVL2 to OVCC2
• IVL3 to OVCC3
• IVL4 to OVCC4
Remember, the pins that start with "I" are input signals that are to be level shifted.  The pins beginning with the letter "O" are output signals that have been level shifted and are ready to be read and/or used.

## Step 10: Check It

Try some of these circuits for yourself so that next time you have to think about mixing CMOS and TTL, the thought of level shifting signals doesn't give you a headache.  Sometimes design or economics requires this mixing and it shouldn't be any problem now to intermix these two.

Thanks for reading my instructable.  As always, I look forward to any comments or suggestions you may have regarding this or any of my instructables.

Cheers!
-gian
aka nevdull

## Recommendations

47 4.7K
32 3.7K
174 10K
Large Motors Class

14,616 Enrolled

## 8 Discussions

I don't understand what CD4504 does. Does it change scale up the voltage it gets at its input? I am new to electronics please help.

The idea is that the CD4504 is powered at the higher of the two voltages, so it can output it's input voltage, say 5V, on the output, or, it can lower it to a voltage corresponding to the TTL equivalent. So, if a TTL device sends a HIGH signal, the CD4504 intercepts it, and if the select pin is HIGH, then it will ramp up the voltage if needed to make the corresponding value to the CMOS attached to the output of the IC. Grab the datasheet. It will probably explain it better than I can.

Good luck!

Hi! thankyou for this useful information. I am using a controller
which operates on 3V3. Output of controller goes to a buffer 74HC245
(which operates on 5V). The VOH of controller is 2.9V(min) and the VIH
of the buffer is 3.5V (min). So there are chances that buffer wont
recognize the controller's signal as valid. I checked out the HCT series
of buffer that is 74HCT245 (it's VIH is 2V min). So is it right to use
HCT series instead of HC series. Can you identify the other measures
that can cause problem? or it will work fine? what would be the output
of HCT245 buffer when 3V3 signal is on the input?

Regards

Mehdi

Thank you for the informative instructable. I am currently taking an electronics class and we are covering TTL and CMOS.

OK; I'm just not sure it's new, as opposed to being a republication of an older circuit. I built a logic probe from a single 4009 chip, based on a design from Radio Electronics Magazine, circa 1975... Red for HIGH, Green for LOW, both LEDs off for no connection...

This is OK, I guess. But it's largely a decade or two out of date. You'd be hard-pressed to find either bipolar TTL (ANY of the bipolar ttl families) or 4000 series CMOS in any recently-published project. 74HC logic is pretty much the new standard.

Also, I think you're confusing two issues. One is that 5V TTL output levels (1 is > 2.7V as you say) are not necessarily compatible with CMOS input levels. This turned out to be rarely a problem, and more with supposedly "ttl compatible" devices that output ~3V than with actual TTL chips (which have an output pretty close to 5V, unless heavily loaded.) The other issue is that CMOS logic families can frequently operate off extended power supply levels., while TTL was strictly a 5V family. And there isn't any way that an HC part running on a 2V supply or a cmos microcontroller running at 1.8V is going to produce logic pulse compatible with other chips running at 5V, regardless of logic family. So there you MUST have level shifting.

The reason CMOS has taken over is power consumption. A small 74xx IC consumed as much power as a modern cmos microcontroller, and did a whole lot less.

The HEF and CD 4000 series are alive and well, if mouser/digikey/arrow/avnet inventory can say anything about it. Jameco also has a half page of original 7400 series IC's as well as 3/4 page of 4000 series IC's. My hunch is that people are still using them, even in modern designs.

I appreciate those two issues and they definitely are distinct problems. However, I don't touch on 1.8V ICs except with the maxim IC, which is powered at 5V anyway and intercepts all 1.8V signals. The main issue I discuss here between TTL and CMOS is that by their standards, there is a ~ 1V gap between what they each consider to be HIGH levels, and if a signal falls within that gap it is undefined and behavior is unpredictable.