What does it mean to isolate a field in a word?

I have been reading in the 'computer organization and design' book and I encountered this section:

what operations isolate a field in a word

I know that the answer is logic operations and shift instructions from the book but. I want to know what does it even mean to isolate a field

Consider an 8-bit word whose contents can be described as follows:

• Bits 0–2 encode some value $$x$$.
• Bits 3–4 encode some value $$y$$.
• Bits 5–7 encode some value $$z$$.

Each of these different values is known, in this context, as a field. You can think of it as a field in some form.

Isolating a field out of a word means extracting just the value of the field. For example, denoting the entire word $$w$$, here is how we can isolate each of the fields:

• $$x$$: AND $$w$$ with the mask $$7$$ (which is $$111$$ in binary).
• $$y$$: Right-shift $$w$$ by 3 positions, and AND the result with the mask $$3$$.
• $$z$$: Right-shift $$w$$ by 5 positions.

In C, you could implement these as follows:

x = w & 7;
y = (w >> 3) & 3;
z = w >> 5;

• I got it thank you but why do need to do this AND,Shift stuff, I mean if its just a bits in memory after all I can access it with the proper address ,right ? Mar 24, 2020 at 13:15
• No. You can access memory in byte chunks, but not at the bit level. Under the hood, memory is read in even larger chunks. Mar 24, 2020 at 13:16
• I thought some programs like gdb actually read memory bit by bit because it can 'isolate' some bits according to the size given for the examine command i.e. ( gdb : x/16x or x/4x) Mar 24, 2020 at 13:19
• gdb is using the techniques in my answer. All modern CPUs and microcontrollers I can think of have a byte-addressable or a word-addressable memory model. Mar 24, 2020 at 13:22