Chips that are made with BJTs (such as TTL chips) are often unable to output all the way to the positive rail, but because they also often have asymmetric output impedance (meaning they sink current on low output better than they source current on high output), a pullup resistor can bring the high output almost up to the rail while not disturbing the low output too much. It works because the pullup resistor is a voltage divider with the output impedance.
Tips And Tricks Playlist: /playlist/PLoNmuzhZIVorIpGiz9GH4W2WAxmTZergy
Signal Processing and Filtering Playlist: /playlist/PLoNmuzhZIVoqET_5MEGLc1_VAiTXpyZHw
Digital Logic Playlist: /playlist/PLoNmuzhZIVoqx2abPAWFPvoxk_Qn2Eie0
You can join me on Discord as well! -- https://discord.gg/Rnvpscg