Vout is related to VCC and load and not related to Vin. With no load Vout is VCC and Ground.
You have a different problem. The input level is not good in your application. The input should be below Vcc X .3 =low and above Vcc X .7=high. I think a 3.3V signal is a little low to drive a 5V CMOS input. It is close and some parts will work.
There are "level translator" parts that will work better. A 74HCT part will have lower input levels.
Vout = Vin would imply an analog circuit with a gain of 1
Due to semiconductor junction voltage drops Vout will always be (somewhat) smaller than Vcc
If you need an output voltage higher than your system supply you will need a DC/DC converter or generate a sqaurewave in the uP and build a voltage doubler circuit. E
Thanks a lot, ronsimpson. You've addressed a very important issue I would find If I did so.
The problem with the HCT version is that is not suitable for 3V3 Vcc, but 5V Vcc only.
My target is to protect the Raspberry Pi GPIO through a buffer. For inputs it's clear (just 3V3 Vcc), but for outputs, I'd like to be able to connect to both 3V3 or 5V devices, just swapping the Vcc from 3V3 to 5V or viceversa with just a simple jumper.
Maybe it's not possible to do it so simple, so I guess I'll need to do place the jumper before the buffer and duplicate it (one HCT for 5V and another HC for 3V3).
You need a "level translator". Most have a VCCin and VCCout. (VCCa, VCCb)
( bi-dirctional or uni-directional )
Watch out for supply range. You don't want 1.2V to 3.3V You need 3.3V or less on the input side and 3.3V & 5V on the output.