<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-05-06</periodOfReport>

    <issuer>
        <issuerCik>0000021535</issuerCik>
        <issuerName>COHU INC</issuerName>
        <issuerTradingSymbol>COHU</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001707073</rptOwnerCik>
            <rptOwnerName>Rapp Karen Marie</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>12367 CROSTHWAITE CIRCLE</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>POWAY</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>92064</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Restricted Stock Units</value>
            </securityTitle>
            <transactionDate>
                <value>2024-05-06</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>403</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>403</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Each Restricted Stock Unit (RSU) represents a contingent right to receive one share of Cohu, Inc. Common Stock upon vesting. The RSUs vest in three equal annual installments beginning May 6, 2025 (assuming continued service to the Board of Directors).</footnote>
        <footnote id="F2">Number of shares includes 403 Restricted Stock Units (RSUs) that in the future will be converted on a one-for-one basis into shares of Cohu, Inc. Common Stock immediately upon the vesting date (assuming continued service to the Board of Directors).</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Jeffrey D. Jones, by Power of Attorney</signatureName>
        <signatureDate>2024-05-08</signatureDate>
    </ownerSignature>
</ownershipDocument>
