# How to combine two, separate 4 bit words into a 6 bit one?

How to combine two, 4-bit words into one 6-bit word.

What I want to achieve: Using a matrix keyboard, I would like to control six addresses (A0-A5) of a parallel EEPROM memory in the range from 000000 to 111111. After selecting two decimal numbers on the matrix keyboard, for example, '2' and '3', I would get two 4-bit words (0010) and (0011) at the output, from which I would then like to obtain the number '23' as a 6-bit word (010111). What logic operations should I perform to achieve this result?

This is a part of my project - a binary music / pulse sequencer based on logic gates. The sequencer works in two modes - the first is generating 64 sequences of 8 pulses (triggers) each. Each single sequence is recorded using an ADC, via a potentiometer. In other words, one 'step' is one 8-bit sequence. After recording 64 combinations, the sequencer is switched to playback mode in a loop - from 0-63. It is possible to reset at any time using an external clock and reset signal. The second mode is playback of 8 waveforms stored in the EEPROM memory, 64 bytes each, which allow for modulation (e.g., LFO) through the DAC. Both modes of the sequencer can be used simultaneously - you can control an external device using the generated pulses and also modulate - both modes, however, are synchronized using the same clock. Increasing the speed of the pulses at the sequencer output increases the frequency of the modulation waveforms. The sequencer also has an LFSR source and a 'glide' function. The 'glide' function is a circuit at the DAC output that 'softens' voltage jumps.

The memory cell number is displayed here:

The part of the circuit controls the memory cells with the clock:

• What do you want to happen if the selection is, for example, "85"? Jan 1 at 21:08
• You can use any logic operations you want. It does not matter how the result ends up being what it is. But you might want to be clear that when you push '2' and '3' it means 23 in decimal? If so, do you recall how decimal numbers work? Jan 1 at 21:13
• @JerzyPrzezdziecki You push '2', multiply it by 10, you get 20, push '3' and add it, and get 23. The other thing is, it might be harder to work in decimals than in binary, hex, or octal. Where is this matrix keyboard connected, what output you get and where? To digital logic? To an MCU running code? Jan 1 at 21:32
• It seems way easier to enter the address as two digits base 8. Do you intend to [select two] numbers on [one and the same] matrix keyboard? Jan 1 at 21:33
• @JerzyPrzezdziecki I have to wonder what is the motivation for this project? Is this school work? Jan 1 at 21:48